Merge pull request #6943 from webpack/bugfix/sort-children-for-hash

sort child compilations for consitent hash
This commit is contained in:
Tobias Koppers 2018-04-04 14:35:14 +02:00 committed by GitHub
commit 3f33d88860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 2 deletions

View File

@ -62,6 +62,14 @@ const byIndexOrIdentifier = (a, b) => {
return 0;
};
const byNameOrHash = (a, b) => {
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
if (a.fullHash < b.fullHash) return -1;
if (a.fullhash > b.fullHash) return 1;
return 0;
};
const iterationBlockVariable = (variables, fn) => {
for (
let indexVariable = 0;
@ -1594,6 +1602,7 @@ class Compilation extends Tapable {
this.errors.sort(byMessage);
this.warnings.sort(byMessage);
this.children.sort(byNameOrHash);
}
summarizeDependencies() {
@ -1678,7 +1687,7 @@ class Compilation extends Tapable {
const bEntry = b.hasRuntime();
if (aEntry && !bEntry) return 1;
if (!aEntry && bEntry) return -1;
return 0;
return byId(a, b);
});
for (let i = 0; i < chunks.length; i++) {
const chunk = chunks[i];

View File

@ -1,4 +1,4 @@
Hash: ca712e9bc95207b9082e
Hash: 7a73868d9be286944b0a
Time: Xms
Built at: Thu Jan 01 1970 00:00:00 GMT
Asset Size Chunks Chunk Names