Skip to content

Commit e401603

Browse files
authored
Merge pull request webpack#3956 from jbruni/patch-1
Fixes webpack#3946 (stats options being ignored)
2 parents 49d88f9 + 857f980 commit e401603

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

bin/webpack.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,11 @@ function processOptions(options) {
175175
var statsPresetToOptions = require("../lib/Stats.js").presetToOptions;
176176

177177
var outputOptions = options.stats;
178-
if(typeof outputOptions === "boolean" || typeof outputOptions === "string")
178+
if(typeof outputOptions === "boolean" || typeof outputOptions === "string") {
179179
outputOptions = statsPresetToOptions(outputOptions);
180-
else
180+
} else if(!outputOptions) {
181181
outputOptions = {};
182+
}
182183
outputOptions = Object.create(outputOptions);
183184
if(Array.isArray(options) && !outputOptions.children) {
184185
outputOptions.children = options.map(o => o.stats);

test/binCases/stats/single-config/test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ module.exports = function testAssertions(code, stdout, stderr) {
77
stdout[0].should.containEql("Hash: ");
88
stdout[1].should.containEql("Version: ");
99
stdout[2].should.containEql("Time: ");
10-
stdout[4].should.containEql("null.js");
11-
stdout[5].should.containEql("./index.js");
12-
stdout[5].should.containEql("[built]");
10+
stdout[4].should.containEql("\u001b[1m\u001b[32mnull.js\u001b[39m\u001b[22m");
11+
stdout[5].should.not.containEql("./index.js");
12+
stdout[5].should.not.containEql("[built]");
13+
stdout[5].should.containEql("1 hidden module");
1314

1415
stderr.should.be.empty();
1516
};

test/binCases/stats/single-config/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
stats: {
66
assets: true,
77
colors: true,
8-
chunks: true
8+
chunks: true,
9+
maxModules: 0
910
}
1011
};

0 commit comments

Comments
 (0)