Skip to content

Commit 19c7260

Browse files
committed
Merge branch 'master' into bugfix/fix_stats_when_passed_array
2 parents ea2274a + ff88513 commit 19c7260

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

bin/config-yargs.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,6 @@ module.exports = function(yargs) {
154154
describe: "Watch the filesystem for changes",
155155
group: BASIC_GROUP
156156
},
157-
"save": {
158-
type: "boolean",
159-
alias: "s",
160-
describe: "Rebuilds on save regardless of changes in watch mode",
161-
group: BASIC_GROUP
162-
},
163157
"watch-stdin": {
164158
type: "boolean",
165159
alias: "stdin",

bin/webpack.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,7 @@ function processOptions(options) {
346346
process.stdout.write(JSON.stringify(stats.toJson(outputOptions), null, 2) + "\n");
347347
} else if(stats.hash !== lastHash) {
348348
lastHash = stats.hash;
349-
process.stdout.write("\n" + new Date() + "\n" + "\n");
350349
process.stdout.write(stats.toString(outputOptions) + "\n");
351-
if(argv.s) lastHash = null;
352350
}
353351
if(!options.watch && stats.hasErrors()) {
354352
process.on("exit", function() {

lib/Compilation.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,13 @@ class Compilation extends Tapable {
967967
hash.update(child.hash);
968968
});
969969
let chunk;
970+
// clone needed as sort below is inplace mutation
970971
const chunks = this.chunks.slice();
972+
/**
973+
* sort here will bring all "falsy" values to the beginning
974+
* this is needed as the "hasRuntime()" chunks are dependent on the
975+
* hashes of the non-runtime chunks.
976+
*/
971977
chunks.sort((a, b) => {
972978
const aEntry = a.hasRuntime();
973979
const bEntry = b.hasRuntime();
@@ -979,7 +985,7 @@ class Compilation extends Tapable {
979985
chunk = chunks[i];
980986
const chunkHash = crypto.createHash(hashFunction);
981987
if(outputOptions.hashSalt)
982-
hash.update(outputOptions.hashSalt);
988+
chunkHash.update(outputOptions.hashSalt);
983989
chunk.updateHash(chunkHash);
984990
if(chunk.hasRuntime()) {
985991
this.mainTemplate.updateHashForChunk(chunkHash, chunk);

lib/dependencies/NullDependency.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
const Dependency = require("../Dependency");
77

88
class NullDependency extends Dependency {
9-
constructor() {
10-
super();
11-
}
12-
139
get type() {
1410
return "null";
1511
}

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ module.exports = function testAssertions(code, stdout, stderr) {
44
code.should.be.oneOf(0, 1);
55

66
stdout.should.be.ok();
7-
stdout[3].should.containEql("Hash: ");
8-
stdout[4].should.containEql("Version: ");
9-
stdout[5].should.containEql("Time: ");
10-
stdout[7].should.containEql("null.js");
11-
stdout[8].should.containEql("./index.js");
12-
stdout[8].should.containEql("[built]");
7+
stdout[0].should.containEql("Hash: ");
8+
stdout[1].should.containEql("Version: ");
9+
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]");
1313

1414
stderr.should.be.empty();
1515
}

0 commit comments

Comments
 (0)