Skip to content

Commit

Permalink
Include module file and context dependencies in ConcatenatedModule
Browse files Browse the repository at this point in the history
As ModuleConcatenationPlugin removes the concatenated modules from a
compilation, the file and context dependencies of those modules needs
to be stored in the ConcatenatedModule for webpack to be able to watch
those paths.
  • Loading branch information
mzgoddard committed Jun 22, 2017
1 parent a959fef commit 9ea40f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/optimize/ConcatenatedModule.js
Expand Up @@ -154,6 +154,8 @@ class ConcatenatedModule extends Module {
this.dependencies = [];
this.dependenciesWarnings = [];
this.dependenciesErrors = [];
this.fileDependencies = [];
this.contextDependencies = [];
this.warnings = [];
this.errors = [];
for(const m of modules) {
Expand All @@ -164,6 +166,10 @@ class ConcatenatedModule extends Module {
m.dependenciesWarnings.forEach(depWarning => this.dependenciesWarnings.push(depWarning));
// populate dep errors
m.dependenciesErrors.forEach(depError => this.dependenciesErrors.push(depError));
// populate file dependencies
if(m.fileDependencies) m.fileDependencies.forEach(file => this.fileDependencies.push(file));
// populate context dependencies
if(m.contextDependencies) m.contextDependencies.forEach(context => this.contextDependencies.push(context));
// populate warnings
m.warnings.forEach(warning => this.warnings.push(warning));
// populate errors
Expand Down

0 comments on commit 9ea40f0

Please sign in to comment.