Skip to content

Commit f7ffed8

Browse files
committed
allow to set chunks and use it in ConcatenatedModule
1 parent 7a99930 commit f7ffed8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/Module.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ class Module extends DependenciesBlock {
7474
super.unseal();
7575
}
7676

77+
setChunks(chunks) {
78+
this._chunks = new SortableSet(chunks, sortById);
79+
}
80+
7781
addChunk(chunk) {
7882
this._chunks.add(chunk);
7983
this._chunksDebugIdent = undefined;

lib/optimize/ConcatenatedModule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ function getPathInAst(ast, node) {
130130
class ConcatenatedModule extends Module {
131131
constructor(rootModule, modules) {
132132
super();
133+
super.setChunks(rootModule._chunks);
133134
this.rootModule = rootModule;
134135
this.modules = modules;
135136
this.usedExports = rootModule.usedExports;
136137
this.providedExports = rootModule.providedExports;
137138
this.optimizationBailout = rootModule.optimizationBailout;
138139
this.used = rootModule.used;
139-
this._chunks = new SortedSet(rootModule._chunks, Module.sortById);
140140
this.index = rootModule.index;
141141
this.index2 = rootModule.index2;
142142
this.depth = rootModule.depth;

0 commit comments

Comments
 (0)