DedupePlugin cannot be cached

This commit is contained in:
Tobias Koppers 2016-02-09 22:34:10 +01:00
parent 3939bc40e5
commit b93aacbecf
2 changed files with 6 additions and 1 deletions

View File

@ -18,7 +18,11 @@ CachePlugin.prototype.apply = function(compiler) {
} else { } else {
var _this = this; var _this = this;
compiler.plugin("compilation", function(compilation) { compiler.plugin("compilation", function(compilation) {
compilation.cache = _this.cache; if(compilation.notCacheable) {
compilation.warnings.push(new Error("CachePlugin - Cache cannot be used because of: " + compilation.notCacheable))
} else {
compilation.cache = _this.cache;
}
}); });
compiler.plugin("run", function(compiler, callback) { compiler.plugin("run", function(compiler, callback) {
if(!compiler._lastCompilationFileDependencies) return callback(); if(!compiler._lastCompilationFileDependencies) return callback();

View File

@ -10,6 +10,7 @@ module.exports = DedupePlugin;
DedupePlugin.prototype.apply = function(compiler) { DedupePlugin.prototype.apply = function(compiler) {
compiler.plugin("compilation", function(compilation) { compiler.plugin("compilation", function(compilation) {
compilation.notCacheable = "DedupePlugin";
compilation.dependencyTemplates.set(TemplateArgumentDependency, new TemplateArgumentDependency.Template()); compilation.dependencyTemplates.set(TemplateArgumentDependency, new TemplateArgumentDependency.Template());