【发布时间】:2019-05-05 07:14:57
【问题描述】:
building for production...[ Error: static/js/0.e5262afb6d92aae69c76.js from UglifyJs
`warnings` is not a supported option
at Function.buildError (/mypath/node_modules/_uglifyjs-webpack-plugin@2.0.1@uglifyjs-webpack-plugin/dist/index.js:114:12)
at results.forEach (/mypath/node_modules/_uglifyjs-webpack-plugin@2.0.1@uglifyjs-webpack-plugin/dist/index.js:255:52)
at Array.forEach (<anonymous>)
at taskRunner.run (/mypath/node_modules/_uglifyjs-webpack-plugin@2.0.1@uglifyjs-webpack-plugin/dist/index.js:242:17)
at step (/mypath/node_modules/_uglifyjs-webpack-plugin@2.0.1@uglifyjs-webpack-plugin/dist/TaskRunner.js:76:9)
at done (/mypath/node_modules/_uglifyjs-webpack-plugin@2.0.1@uglifyjs-webpack-plugin/dist/TaskRunner.js:84:30)
at boundWorkers (/mypath/node_modules/_uglifyjs-webpack-plugin@2.0.1@uglifyjs-webpack-plugin/dist/TaskRunner.js:89:13)
at /mypath/node_modules/_worker-farm@1.7.0@worker-farm/lib/farm.js:199:19
at process._tickCallback (internal/process/next_tick.js:61:11),
Error: static/js/1.89c4c336d047e363641c.js from UglifyJs
今天npm run build时出现这个错误,
4 天前一切正常。
今天当我更新我的本地 node_modules 时,它就发生了。
我想应该是前几天发布了新版本的某个包
任何帮助将不胜感激!
更新
这个错误是上个版本uglify-js@3.5.10引起的,
去掉选项中的warnings可以暂时修复这个错误。
uglifyOptions: {
compress: {
warnings: false,
pure_funcs: ['console.log']
}
}
【问题讨论】: