Skip to content

Commit 01c017e

Browse files
committed
Merge pull request webpack#267 from syranide/ugjsout
Support any UglifyJS OutputStream option {output: {...}}
2 parents aa83dad + 3f20c27 commit 01c017e

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

lib/optimize/UglifyJsPlugin.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,14 @@ UglifyJsPlugin.prototype.apply = function(compiler) {
7575
file: file,
7676
root: ""
7777
});
78-
var stream = uglify.OutputStream({
79-
comments: options.comments || /^\**!|@preserve|@license/,
80-
beautify: options.beautify,
81-
source_map: map
82-
});
78+
var output = {};
79+
output.comments = options.comments || /^\**!|@preserve|@license/;
80+
output.beautify = options.beautify;
81+
for(var k in options.output) {
82+
output[k] = options.output[k];
83+
}
84+
output.source_map = map;
85+
var stream = uglify.OutputStream(output);
8386
ast.print(stream);
8487
map = map + "";
8588
stream = stream + "";

0 commit comments

Comments
 (0)