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

View File

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