Skip to content

Commit dcc9d58

Browse files
committed
fixes webpack#819
1 parent 7541a8e commit dcc9d58

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

‎lib/MultiCompiler.js‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@ MultiStats.prototype.toJson = function(options, forToString) {
137137
obj.name = stat.compilation && stat.compilation.name;
138138
return obj;
139139
});
140-
return {
141-
version: require("../package.json").version,
142-
hash: this.hash,
140+
var obj = {
143141
errors: jsons.reduce(function(arr, j) {
144142
return arr.concat(j.errors.map(function(msg) {
145143
return "(" + j.name + ") " + msg
@@ -149,9 +147,15 @@ MultiStats.prototype.toJson = function(options, forToString) {
149147
return arr.concat(j.warnings.map(function(msg) {
150148
return "(" + j.name + ") " + msg
151149
}));
152-
}, []),
153-
children: jsons
150+
}, [])
154151
};
152+
if(!options || options.version !== false)
153+
obj.version = require("../package.json").version;
154+
if(!options || options.hash !== false)
155+
obj.hash = this.hash;
156+
if(!options || options.children !== false)
157+
obj.children = jsons;
158+
return obj;
155159
};
156160

157161
MultiStats.prototype.toString = Stats.prototype.toString;

0 commit comments

Comments
 (0)