feat: make babel-loader exclude configurable

This commit is contained in:
Clark Du 2018-05-05 21:26:03 +01:00
parent 7d92486a07
commit 021ba5a1e2
2 changed files with 7 additions and 5 deletions

View File

@ -40,6 +40,7 @@ export default class WebpackBaseConfig {
] ]
} }
delete options.exclude
return options return options
} }
@ -139,10 +140,7 @@ export default class WebpackBaseConfig {
}, },
{ {
test: /\.jsx?$/, test: /\.jsx?$/,
exclude: file => ( exclude: this.options.build.babel.exclude,
/node_modules/.test(file) &&
!/\.vue\.js/.test(file)
),
use: perfLoader.pool('js', { use: perfLoader.pool('js', {
loader: 'babel-loader', loader: 'babel-loader',
options: this.getBabelOptions() options: this.getBabelOptions()

View File

@ -61,7 +61,11 @@ export default {
}, },
babel: { babel: {
babelrc: false, babelrc: false,
cacheDirectory: undefined cacheDirectory: undefined,
exclude: file => (
/node_modules/.test(file) &&
!/\.vue\.js/.test(file)
)
}, },
vueLoader: {}, vueLoader: {},
postcss: {}, postcss: {},