如何在vue cli3中使用babel-loader排除?

问题描述 投票:0回答:1

我想使用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
vue.js babel vue-cli vue-cli-3 babel-loader
1个回答
0
投票

只需删除此:

.use('babel-loader')
.loader('babel-loader')

它的工作原理。

© www.soinside.com 2019 - 2024. All rights reserved.