Skip to content

Commit 1021faf

Browse files
hh9527sokra
authored andcommitted
Fix webpack#1983 : Object properties can be mangle now.
Use the following config: ```js { plugins: [ new webpack.optimize.UglifyJsPlugin({ mangle: { props: { regex: /_$/ }, }, }), ] } ```
1 parent 6431038 commit 1021faf

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/optimize/UglifyJsPlugin.js

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

0 commit comments

Comments
 (0)