Skip to content

Commit eb8de15

Browse files
committed
Fix webpack#1983 : Object properties can be mangle now.
Use the following config: ```js { plugins: [ new webpack.optimize.UglifyJsPlugin({ mangle: { props: { regex: /_$/ }, }, }), ] } ```
1 parent 668a5f0 commit eb8de15

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/optimize/UglifyJsPlugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ UglifyJsPlugin.prototype.apply = function(compiler) {
9191
ast.figure_out_scope();
9292
ast.compute_char_frequency(options.mangle || {});
9393
ast.mangle_names(options.mangle || {});
94+
if(options.mangle.props) {
95+
uglify.mangle_properties(ast, options.mangle.props);
96+
}
9497
}
9598
var output = {};
9699
output.comments = Object.prototype.hasOwnProperty.call(options, "comments") ? options.comments : /^\**!|@preserve|@license/;

0 commit comments

Comments
 (0)