Skip to content

Commit e20c485

Browse files
committed
reset module index and index2 when loading from cache
consistent entry order
1 parent 34b474d commit e20c485

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

lib/Compilation.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ Compilation.prototype.rebuildModule = function(module, thisCallback) {
485485

486486
Compilation.prototype.seal = function seal(callback) {
487487
this.applyPlugins("seal");
488+
this.preparedChunks.sort(function(a, b) {
489+
if(a.name < b.name) return -1;
490+
if(a.name > b.name) return 1;
491+
return 0;
492+
});
488493
this.preparedChunks.forEach(function(preparedChunk) {
489494
var module = preparedChunk.module;
490495
var chunk = this.addChunk(preparedChunk.name, module);

lib/Module.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ function Module() {
1313
this.debugId = debugId++;
1414
this.lastId = -1;
1515
this.id = null;
16+
this.index = null;
17+
this.index2 = null;
1618
this.chunks = [];
1719
this.warnings = [];
1820
this.dependenciesWarnings = [];
@@ -27,6 +29,8 @@ Module.prototype.disconnect = function() {
2729
this.reasons.length = 0;
2830
this.lastId = this.id;
2931
this.id = null;
32+
this.index = null;
33+
this.index2 = null;
3034
this.chunks.length = 0;
3135
DependenciesBlock.prototype.disconnect.call(this);
3236
};

0 commit comments

Comments
 (0)