iview-cli icon indicating copy to clipboard operation
iview-cli copied to clipboard

babel-loader should exclude node_modules on testing iview*.js

Open 0xffff00 opened this issue 8 years ago • 0 comments

webpack.base.config.js中与iview*.js对应的babel-loader规则也许应该加上: exclude: /node_modules/

            {
                test: /iview\/.*?js$/,
                loader: 'babel-loader' 
                exclude: /node_modules/  <------少了这一行,this line should be added
            },
            {
                test: /\.js$/,
                loader: 'babel-loader',
                exclude: /node_modules/
            },

不加的话,执行webpack时,windows下没问题,在linux上会报[BABEL] Note: The code generator has deoptimised the styling of "..." as it exceeds the max of "500KB". 最终编译出来的静态文件会报错 具体请参见:

  • (https://github.com/0xffff00/skfe/issues/20#issuecomment-359155368)
  • (https://github.com/babel/babel/issues/6041#issuecomment-319589192)

0xffff00 avatar Jan 22 '18 01:01 0xffff00