Skip to content

Commit 92364dc

Browse files
committed
avoid reassigning stream with different value in UglifyJsPlugin
1 parent 104398f commit 92364dc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎lib/optimize/UglifyJsPlugin.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ class UglifyJsPlugin {
108108
});
109109
output.source_map = map; // eslint-disable-line camelcase
110110
}
111-
let stream = uglify.OutputStream(output); // eslint-disable-line new-cap
111+
const stream = uglify.OutputStream(output); // eslint-disable-line new-cap
112112
ast.print(stream);
113113
if(map) map = map + "";
114-
stream = stream + "";
114+
const stringifiedStream = stream + "";
115115
asset.__UglifyJsPlugin = compilation.assets[file] = (map ?
116-
new SourceMapSource(stream, file, JSON.parse(map), input, inputSourceMap) :
117-
new RawSource(stream));
116+
new SourceMapSource(stringifiedStream, file, JSON.parse(map), input, inputSourceMap) :
117+
new RawSource(stringifiedStream));
118118
if(warnings.length > 0) {
119119
compilation.warnings.push(new Error(file + " from UglifyJs\n" + warnings.join("\n")));
120120
}

0 commit comments

Comments
 (0)