我想使用exclude来忽略一些dir而不能编译,但在Vue Cli3中,它不起作用。我的选择是:
chainWebpack: config => {
config.module
.rule('js')
.test(/\.jsx?$/)
.use('babel-loader')
.loader('babel-loader')
.exclude
.add(resolve('src/libs/iview')) // this line not work
.end();
}
错误:
TypeError: Cannot read property 'add' of undefined
只需删除此:
.use('babel-loader')
.loader('babel-loader')
它的工作原理。