Skip to content

Commit

Permalink
Instantiate MemoryFileSystem only once (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
moljac024 authored and SpaceK33z committed Sep 13, 2016
1 parent 5a71653 commit 92403e9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ module.exports = function(compiler, options) {
if(typeof options.reporter !== "function") options.reporter = defaultReporter;

// store our files in memory
var fs = compiler.outputFileSystem = new MemoryFileSystem();
var fs;
var isMemoryFs = compiler.outputFileSystem instanceof MemoryFileSystem;
if(isMemoryFs) {
fs = compiler.outputFileSystem;
} else {
fs = compiler.outputFileSystem = new MemoryFileSystem();
}

compiler.plugin("done", function(stats) {
// We are now on valid state
Expand Down

0 comments on commit 92403e9

Please sign in to comment.