webpack 打包压缩 ES6文件报错UglifyJs + Unexpected token punc ((); 或者 Unexpected token: operator (>)
解决方案就是将babel配置转义到 .babelrc 文件中。具体做法是在根目录新建 .babel,输入
{ "presets": ["es2015"] }
在webpack加载babel-loader的时候会自动加载.babelrc配置的。
webpack 打包压缩 ES6文件报错UglifyJs + Unexpected token punc ((); 或者 Unexpected token: operator (>)
解决方案就是将babel配置转义到 .babelrc 文件中。具体做法是在根目录新建 .babel,输入
{ "presets": ["es2015"] }
在webpack加载babel-loader的时候会自动加载.babelrc配置的。
转载于:https://www.cnblogs.com/CyLee/p/8425150.html