Skip to content
This repository was archived by the owner on Feb 1, 2021. It is now read-only.

Commit 3c72190

Browse files
ZauberNerddmbch
authored andcommitted
fix(webpack): turn off function inlining to avoid const reassignment
Due to a bug in UglifyJS (mishoo/UglifyJS#2842) we should disable function inlining to avoid falling into this issue. the uglifyjs-webpack-plugin module is considering to move to the maintained fork of UglifyJS (terser: https://github.com/fabiosantoscode/terser): - webpack-contrib/uglifyjs-webpack-plugin#264 - webpack-contrib/uglifyjs-webpack-plugin#296 But until that happens I'd propose to disable function inlining.
1 parent a9f6a1a commit 3c72190

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/webpack/lib/configs/build.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ module.exports = function getConfig(config, configureBuild) {
118118
parallel: true,
119119
sourceMap: true,
120120
uglifyOptions: {
121-
output: { comments: false },
121+
compress: {
122+
inline: 1, // https://github.com/mishoo/UglifyJS2/issues/2842
123+
},
124+
output: {
125+
comments: false,
126+
},
122127
},
123128
}),
124129
],

0 commit comments

Comments
 (0)