Skip to content

Commit fa4ffd7

Browse files
committed
WIP11
1 parent e5349ad commit fa4ffd7

File tree

78 files changed

+943
-1293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+943
-1293
lines changed

lib/Compilation.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ class Compilation extends Tapable {
733733
this.hooks.unseal.call();
734734
this.chunks.length = 0;
735735
this.chunkGroups.length = 0;
736+
this.namedChunks.clear();
736737
this.namedChunkGroups.clear();
737738
this.additionalChunkAssets.length = 0;
738739
this.assets = {};
@@ -1410,15 +1411,13 @@ class Compilation extends Tapable {
14101411

14111412
usedIds.add(usedIdValue);
14121413
}
1413-
console.log("Compilation usedIds = ", usedIds);
14141414

14151415
// Calculate maximum assigned chunk id
14161416
let nextFreeChunkId = -1;
14171417
for(const id of usedIds) {
14181418
nextFreeChunkId = Math.max(nextFreeChunkId, id);
14191419
}
14201420
nextFreeChunkId++;
1421-
console.log("Compilation nextFreeChunkId = ", nextFreeChunkId);
14221421

14231422
// Determine free chunk ids from 0 to maximum
14241423
const unusedIds = [];
@@ -1430,7 +1429,6 @@ class Compilation extends Tapable {
14301429
}
14311430
}
14321431
}
1433-
console.log("Compilation unusedIds = ", unusedIds);
14341432

14351433
// Assign ids to chunk which has no id
14361434
for(let indexChunk = 0; indexChunk < chunks.length; indexChunk++) {

lib/Module.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ class Module extends DependenciesBlock {
285285
}
286286

287287
updateHash(hash) {
288-
hash.update(this.id + "" + this.used);
288+
hash.update(`${this.id}`);
289289
hash.update(JSON.stringify(this.usedExports));
290290
super.updateHash(hash);
291291
}

lib/RecordIdsPlugin.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ class RecordIdsPlugin {
3838
module.id = id;
3939
});
4040
}
41-
compilation.usedModuleIds = new Set(records.modules.usedIds);
41+
if(Array.isArray(records.modules.usedIds))
42+
compilation.usedModuleIds = new Set(records.modules.usedIds);
4243
});
4344

4445
const getModuleIdentifier = module => {
@@ -82,7 +83,6 @@ class RecordIdsPlugin {
8283
records.chunks.usedIds = Array.from(usedIds);
8384
});
8485
compilation.hooks.reviveChunks.tap("RecordIdsPlugin", (chunks, records) => {
85-
console.log("RecordIdsPlugin.reviveChunks");
8686
if(!records.chunks) return;
8787
const usedIds = new Set();
8888
if(records.chunks.byName) {
@@ -93,7 +93,6 @@ class RecordIdsPlugin {
9393
if(id === undefined) return;
9494
if(usedIds.has(id)) return;
9595
usedIds.add(id);
96-
console.log(`RecordsIdPlugin: assign chunk id ${id}`);
9796
chunk.id = id;
9897
});
9998
}
@@ -106,12 +105,12 @@ class RecordIdsPlugin {
106105
if(usedIds[id]) continue;
107106
usedIds[id] = true;
108107
chunk.id = id;
109-
console.log(`RecordsIdPlugin: assign chunk id ${id}`);
110108
break;
111109
}
112110
});
113111
}
114-
compilation.usedChunkIds = new Set(records.chunks.usedIds);
112+
if(Array.isArray(records.chunks.usedIds))
113+
compilation.usedChunkIds = new Set(records.chunks.usedIds);
115114
});
116115
});
117116
}

0 commit comments

Comments
 (0)