Skip to content

Commit b0caa69

Browse files
committed
fixed file system purging
1 parent 20ad2ba commit b0caa69

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

bin/webpack.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,7 @@ var lastHash = null;
129129
var compiler = webpack(options, function(err, stats) {
130130
if(!options.watch) {
131131
// Do not keep cache anymore
132-
var ifs = compiler.inputFileSystem;
133-
if(ifs && ifs.purge) ifs.purge();
132+
compiler.purgeInputFileSystem();
134133
}
135134
if(err) {
136135
lastHash = null;

lib/Compiler.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,11 @@ Compiler.prototype.runAsChild = function(callback) {
200200
}.bind(this));
201201
};
202202

203+
Compiler.prototype.purgeInputFileSystem = function() {
204+
if(this.inputFileSystem && this.inputFileSystem.purge)
205+
this.inputFileSystem.purge();
206+
};
207+
203208
Compiler.prototype.emitAssets = function(compilation, callback) {
204209
var outputPath;
205210

lib/MultiCompiler.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ MultiCompiler.prototype.run = function(callback) {
8787
});
8888
};
8989

90+
MultiCompiler.prototype.purgeInputFileSystem = function() {
91+
this.compilers.forEach(function(compiler) {
92+
if(compiler.inputFileSystem && compiler.inputFileSystem.purge)
93+
compiler.inputFileSystem.purge();
94+
});
95+
};
96+
9097
function MultiStats(stats) {
9198
this.stats = stats;
9299
this.hash = stats.map(function(stat) {

0 commit comments

Comments
 (0)