ERROR in static/js/vendors~app~vendors.0136d2d5.js from UglifyJs undefined
windows平台,node: v8.17.0 执行npm run prod, uglifyjs-webpack-plugin会在混淆压缩中报错
windows平台,node: v8.17.0 执行npm run prod, uglifyjs-webpack-plugin会在混淆压缩中报错
抱歉身边没windows的设备,不过uglifyjs这个如果babel没有处理好高版本的语法的话,压缩会有问题,可以替换为terser-webpack-plugin试试看。 这个项目demo比较老,已经不维护了。
uglifyjs-webpack-plugin作为压缩混淆插件,自2.x版本后基于uglify-js,故不再支持es6的压缩。官方推荐webpack4内置terser-webpack-plugin(支持es6压缩)或者降级版本(支持es6压缩)。
其实我想明白的是2.x版本的目的是不是在压缩阶段就进行拦截,对于存在未转译es6代码直接报错,让低版本浏览器达到更好的兼容。
可是我自己搭的小案例用2.x版本测试都是如上类似的报错,看到你的项目中使用才有此疑问,不明白是这个插件的问题,还是其他。
------------------ 原始邮件 ------------------ 发件人: "CodeLittlePrince/vue-construct" <[email protected]>; 发送时间: 2020年12月30日(星期三) 中午1:57 收件人: "CodeLittlePrince/vue-construct"<[email protected]>; 抄送: "1204914685"<[email protected]>;"Author"<[email protected]>; 主题: Re: [CodeLittlePrince/vue-construct] ERROR in static/js/vendors~app~vendors.0136d2d5.js from UglifyJs undefined (#3)
windows平台,node: v8.17.0 执行npm run prod, uglifyjs-webpack-plugin会在混淆压缩中报错
抱歉身边没windows的设备,不过uglifyjs这个如果babel没有处理好高版本的语法的话,压缩会有问题,可以替换为terser-webpack-plugin试试看。 这个项目demo比较老,已经不维护了。
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
恩,uglifyjs-webpack-plugin对于不能转译的语法的确是会报错中断了。不然你想想,它不告诉你他转译不了,或只是warning提示,使用者可能注意不到这个问题,然后项目上线了,那样的话,会被开发者吐槽惨的。
font{
line-height: 1.6;
}
ul,ol{
padding-left: 20px;
list-style-position: inside;
}
恩,uglifyjs-webpack-plugin对于不能转译的语法的确是会报错中断了。不然你想想,它不告诉你他转译不了,或只是warning提示,使用者可能注意不到这个问题,然后项目上线了,那样的话,会被开发者吐槽惨的。
1006312908
[email protected]
签名由
网易邮箱大师
定制
On 12/30/2020 14:10,yang1212<[email protected]> wrote:
uglifyjs-webpack-plugin作为压缩混淆插件,自2.x版本后基于uglify-js,故不再支持es6的压缩。官方推荐webpack4内置terser-webpack-plugin(支持es6压缩)或者降级版本(支持es6压缩)。
其实我想明白的是2.x版本的目的是不是在压缩阶段就进行拦截,对于存在未转译es6代码直接报错,让低版本浏览器达到更好的兼容。
可是我自己搭的小案例用2.x版本测试都是如上类似的报错,看到你的项目中使用才有此疑问,不明白是这个插件的问题,还是其他。
------------------ 原始邮件 ------------------
发件人: "CodeLittlePrince/vue-construct" <[email protected]>;
发送时间: 2020年12月30日(星期三) 中午1:57
收件人: "CodeLittlePrince/vue-construct"<[email protected]>;
抄送: "1204914685"<[email protected]>;"Author"<[email protected]>;
主题: Re: [CodeLittlePrince/vue-construct] ERROR in static/js/vendors~app~vendors.0136d2d5.js from UglifyJs undefined (#3)
windows平台,node: v8.17.0
执行npm run prod, uglifyjs-webpack-plugin会在混淆压缩中报错
抱歉身边没windows的设备,不过uglifyjs这个如果babel没有处理好高版本的语法的话,压缩会有问题,可以替换为terser-webpack-plugin试试看。
这个项目demo比较老,已经不维护了。
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or unsubscribe.