Skip to content

Commit

Permalink
ContextReplacementPlugin should remove critical dependency warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jul 20, 2016
1 parent 711a382 commit 0c78ca7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
10 changes: 10 additions & 0 deletions lib/ContextReplacementPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ ContextReplacementPlugin.prototype.apply = function(compiler) {
result.regExp = newContentRegExp;
if(typeof newContentCallback === "function") {
newContentCallback(result);
} else {
result.dependencies.forEach(function(d) {
if(d.critical)
d.critical = false;
});
}
}
return callback(null, result);
Expand All @@ -73,6 +78,11 @@ ContextReplacementPlugin.prototype.apply = function(compiler) {
if(result.resource !== origResource) {
result.resource = path.resolve(origResource, result.resource);
}
} else {
result.dependencies.forEach(function(d) {
if(d.critical)
d.critical = false;
});
}
}
return callback(null, result);
Expand Down
3 changes: 0 additions & 3 deletions test/configCases/context-replacement/a/warnings.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/configCases/context-replacement/b/warnings.js

This file was deleted.

3 changes: 0 additions & 3 deletions test/configCases/context-replacement/c/warnings.js

This file was deleted.

0 comments on commit 0c78ca7

Please sign in to comment.