Skip to content

Commit b93aacb

Browse files
committed
DedupePlugin cannot be cached
1 parent 3939bc4 commit b93aacb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/CachePlugin.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ CachePlugin.prototype.apply = function(compiler) {
1818
} else {
1919
var _this = this;
2020
compiler.plugin("compilation", function(compilation) {
21-
compilation.cache = _this.cache;
21+
if(compilation.notCacheable) {
22+
compilation.warnings.push(new Error("CachePlugin - Cache cannot be used because of: " + compilation.notCacheable))
23+
} else {
24+
compilation.cache = _this.cache;
25+
}
2226
});
2327
compiler.plugin("run", function(compiler, callback) {
2428
if(!compiler._lastCompilationFileDependencies) return callback();

lib/optimize/DedupePlugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ module.exports = DedupePlugin;
1010

1111
DedupePlugin.prototype.apply = function(compiler) {
1212
compiler.plugin("compilation", function(compilation) {
13+
compilation.notCacheable = "DedupePlugin";
1314

1415
compilation.dependencyTemplates.set(TemplateArgumentDependency, new TemplateArgumentDependency.Template());
1516

0 commit comments

Comments
 (0)