Skip to content

Commit

Permalink
allow to set chunks and use it in ConcatenatedModule
Browse files Browse the repository at this point in the history
  • Loading branch information
timse committed Jun 20, 2017
1 parent 7a99930 commit f7ffed8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/Module.js
Expand Up @@ -74,6 +74,10 @@ class Module extends DependenciesBlock {
super.unseal();
}

setChunks(chunks) {
this._chunks = new SortableSet(chunks, sortById);
}

addChunk(chunk) {
this._chunks.add(chunk);
this._chunksDebugIdent = undefined;
Expand Down
2 changes: 1 addition & 1 deletion lib/optimize/ConcatenatedModule.js
Expand Up @@ -130,13 +130,13 @@ function getPathInAst(ast, node) {
class ConcatenatedModule extends Module {
constructor(rootModule, modules) {
super();
super.setChunks(rootModule._chunks);
this.rootModule = rootModule;
this.modules = modules;
this.usedExports = rootModule.usedExports;
this.providedExports = rootModule.providedExports;
this.optimizationBailout = rootModule.optimizationBailout;
this.used = rootModule.used;
this._chunks = new SortedSet(rootModule._chunks, Module.sortById);
this.index = rootModule.index;
this.index2 = rootModule.index2;
this.depth = rootModule.depth;
Expand Down

0 comments on commit f7ffed8

Please sign in to comment.