mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-04-06 03:59:53 +08:00
fix: exclude
This commit is contained in:
parent
0d51dd6c3a
commit
f3be2f767f
@ -126,14 +126,8 @@ export default async function getConfig({ api, cwd, config, env, entry = {}, mod
|
|||||||
webpackConfig.module
|
webpackConfig.module
|
||||||
.rule('js')
|
.rule('js')
|
||||||
.test(/\.(js|mjs)$/)
|
.test(/\.(js|mjs)$/)
|
||||||
.exclude.add((filepath) => {
|
|
||||||
// always transpile js in vue files
|
|
||||||
if (/(\.vue|\.jsx)$/.test(filepath)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Don't transpile node_modules
|
// Don't transpile node_modules
|
||||||
return /node_modules/.test(filepath);
|
.exclude.add((filepath) => /node_modules/.test(filepath))
|
||||||
})
|
|
||||||
.end()
|
.end()
|
||||||
.use('swc-loader')
|
.use('swc-loader')
|
||||||
.loader(require.resolve('swc-loader'))
|
.loader(require.resolve('swc-loader'))
|
||||||
@ -141,14 +135,6 @@ export default async function getConfig({ api, cwd, config, env, entry = {}, mod
|
|||||||
webpackConfig.module
|
webpackConfig.module
|
||||||
.rule('jsx')
|
.rule('jsx')
|
||||||
.test(/\.jsx$/)
|
.test(/\.jsx$/)
|
||||||
.exclude.add((filepath) => {
|
|
||||||
// always transpile js in vue files
|
|
||||||
if (/(\.vue|\.jsx)$/.test(filepath)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Don't transpile node_modules
|
|
||||||
return /node_modules/.test(filepath);
|
|
||||||
})
|
|
||||||
.end()
|
.end()
|
||||||
.use('swc-loader')
|
.use('swc-loader')
|
||||||
.loader(require.resolve('swc-loader'))
|
.loader(require.resolve('swc-loader'))
|
||||||
@ -157,14 +143,6 @@ export default async function getConfig({ api, cwd, config, env, entry = {}, mod
|
|||||||
webpackConfig.module
|
webpackConfig.module
|
||||||
.rule('ts')
|
.rule('ts')
|
||||||
.test(/\.ts$/)
|
.test(/\.ts$/)
|
||||||
.exclude.add((filepath) => {
|
|
||||||
// always transpile js in vue files
|
|
||||||
if (/(\.vue|\.tsx)$/.test(filepath)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Don't transpile node_modules
|
|
||||||
return /node_modules/.test(filepath);
|
|
||||||
})
|
|
||||||
.end()
|
.end()
|
||||||
.use('swc-loader')
|
.use('swc-loader')
|
||||||
.loader(require.resolve('swc-loader'))
|
.loader(require.resolve('swc-loader'))
|
||||||
@ -172,14 +150,6 @@ export default async function getConfig({ api, cwd, config, env, entry = {}, mod
|
|||||||
webpackConfig.module
|
webpackConfig.module
|
||||||
.rule('tsx')
|
.rule('tsx')
|
||||||
.test(/\.tsx$/)
|
.test(/\.tsx$/)
|
||||||
.exclude.add((filepath) => {
|
|
||||||
// always transpile js in vue files
|
|
||||||
if (/(\.vue|\.tsx)$/.test(filepath)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Don't transpile node_modules
|
|
||||||
return /node_modules/.test(filepath);
|
|
||||||
})
|
|
||||||
.end()
|
.end()
|
||||||
.use('swc-loader')
|
.use('swc-loader')
|
||||||
.loader(require.resolve('swc-loader'))
|
.loader(require.resolve('swc-loader'))
|
||||||
@ -217,7 +187,7 @@ export default async function getConfig({ api, cwd, config, env, entry = {}, mod
|
|||||||
.test(/\.(js|mjs|jsx|ts|tsx)$/)
|
.test(/\.(js|mjs|jsx|ts|tsx)$/)
|
||||||
.exclude.add((filepath) => {
|
.exclude.add((filepath) => {
|
||||||
// always transpile js in vue files
|
// always transpile js in vue files
|
||||||
if (/(\.vue|\.jsx)$/.test(filepath)) {
|
if (/(\.tsx|\.ts|\.jsx)$/.test(filepath)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Don't transpile node_modules
|
// Don't transpile node_modules
|
||||||
|
Loading…
x
Reference in New Issue
Block a user