Skip to content

Commit cc8bfaa

Browse files
committed
better solution for supid node.js stream flushing
1 parent 42d5c05 commit cc8bfaa

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

bin/webpack.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,7 @@ webpack(options, function(err, stats) {
108108
}
109109
if(!options.watch) {
110110
// Do not keep cache anymore
111-
// but wait until stdout has been written
112-
process.nextTick(function() {
113-
if(!process.stdout.write("")) {
114-
process.stdout.once("drain", function() {
115-
if(!process.stderr.write("")) {
116-
process.stderr.once("drain", function() {
117-
process.exit();
118-
});
119-
} else
120-
process.exit();
121-
});
122-
} else
123-
process.exit();
124-
});
111+
var ifs = stats.compilation.compiler.inputFileSystem;
112+
if(ifs && ifs.purge) ifs.purge();
125113
}
126114
});

0 commit comments

Comments
 (0)