gpt4 book ai didi

webpack - `warnings` 不是受支持的选项,来自 UglifyJs 的错误

转载 作者:行者123 更新时间:2023-12-04 05:36:04 25 4
gpt4 key购买 nike

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 in options 可以暂时修复这个错误。
    uglifyOptions: {
compress: {
warnings: false,
pure_funcs: ['console.log']
}
}

最佳答案

是 Uglify-js 升级引起的,详情见:https://github.com/mishoo/UglifyJS2/issues/3394

解决办法是:

用:

{
"warnings": value
}

代替:
{
"compress": {
"warnings": value
}
}

关于webpack - `warnings` 不是受支持的选项,来自 UglifyJs 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55989693/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com