Skip to content

Commit 9e60f2c

Browse files
committed
fixup integratedSize to reflect original functionality
1 parent 7305593 commit 9e60f2c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

lib/Chunk.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,16 @@ class Chunk {
298298
return false;
299299
}
300300

301-
const modulesSize = this.modulesSize() + otherChunk.modulesSize();
302-
return this.addMultiplierAndOverhead(modulesSize, options);
301+
let integratedModulesSize = this.modulesSize();
302+
// only count modules that do not exist in this chunk!
303+
for(let i = 0; i < otherChunk.modules.length; i++) {
304+
const otherModule = otherChunk.modules[i];
305+
if(this.modules.indexOf(otherModule) === -1) {
306+
integratedModulesSize += otherModule.size();
307+
}
308+
}
309+
310+
return this.addMultiplierAndOverhead(integratedModulesSize, options);
303311
}
304312

305313
getChunkMaps(includeEntries, realHash) {

0 commit comments

Comments
 (0)