Skip to content

Commit 9833d09

Browse files
committed
Correctly deep extend the stats file contents
1 parent 80adb9d commit 9833d09

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ var path = require('path');
22
var fs = require('fs');
33
var stripAnsi = require('strip-ansi');
44
var mkdirp = require('mkdirp');
5+
var extend = require('deep-extend');
56

67
var assets = {};
78
var DEFAULT_OUTPUT_FILENAME = 'webpack-stats.json';
@@ -88,7 +89,7 @@ Plugin.prototype.writeOutput = function(compiler, contents) {
8889
}
8990
mkdirp.sync(path.dirname(outputFilename));
9091

91-
this.contents = Object.assign(this.contents, contents);
92+
this.contents = extend(this.contents, contents);
9293
fs.writeFileSync(
9394
outputFilename,
9495
JSON.stringify(this.contents, null, this.options.indent)

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"url": "https://github.com/owais/webpack-bundle-tracker/issues"
2929
},
3030
"dependencies": {
31+
"deep-extend": "^0.4.1",
3132
"mkdirp": "^0.5.1",
3233
"strip-ansi": "^2.0.1"
3334
}

0 commit comments

Comments
 (0)