fixed file system purging

This commit is contained in:
Tobias Koppers 2014-06-11 22:52:02 +02:00
parent 20ad2baf9a
commit b0caa69ae1
3 changed files with 13 additions and 2 deletions

View File

@ -129,8 +129,7 @@ var lastHash = null;
var compiler = webpack(options, function(err, stats) { var compiler = webpack(options, function(err, stats) {
if(!options.watch) { if(!options.watch) {
// Do not keep cache anymore // Do not keep cache anymore
var ifs = compiler.inputFileSystem; compiler.purgeInputFileSystem();
if(ifs && ifs.purge) ifs.purge();
} }
if(err) { if(err) {
lastHash = null; lastHash = null;

View File

@ -200,6 +200,11 @@ Compiler.prototype.runAsChild = function(callback) {
}.bind(this)); }.bind(this));
}; };
Compiler.prototype.purgeInputFileSystem = function() {
if(this.inputFileSystem && this.inputFileSystem.purge)
this.inputFileSystem.purge();
};
Compiler.prototype.emitAssets = function(compilation, callback) { Compiler.prototype.emitAssets = function(compilation, callback) {
var outputPath; var outputPath;

View File

@ -87,6 +87,13 @@ MultiCompiler.prototype.run = function(callback) {
}); });
}; };
MultiCompiler.prototype.purgeInputFileSystem = function() {
this.compilers.forEach(function(compiler) {
if(compiler.inputFileSystem && compiler.inputFileSystem.purge)
compiler.inputFileSystem.purge();
});
};
function MultiStats(stats) { function MultiStats(stats) {
this.stats = stats; this.stats = stats;
this.hash = stats.map(function(stat) { this.hash = stats.map(function(stat) {