Skip to content

Commit 639a1ec

Browse files
committed
faster exit when error
1 parent e8976b7 commit 639a1ec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bin/webpack.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ ifArg("hide-modules", function(bool) {
118118
var webpack = require("../lib/webpack.js");
119119

120120
Error.stackTrackLimit = 30;
121-
webpack(options, function(err, stats) {
121+
var compiler = webpack(options, function(err, stats) {
122+
if(!options.watch) {
123+
// Do not keep cache anymore
124+
var ifs = compiler.inputFileSystem;
125+
if(ifs && ifs.purge) ifs.purge();
126+
}
122127
if(err) {
123128
console.error(err.stack || err);
124129
if(!options.watch) {
@@ -133,9 +138,4 @@ webpack(options, function(err, stats) {
133138
else {
134139
process.stdout.write(stats.toString(outputOptions) + "\n");
135140
}
136-
if(!options.watch) {
137-
// Do not keep cache anymore
138-
var ifs = stats.compilation.compiler.inputFileSystem;
139-
if(ifs && ifs.purge) ifs.purge();
140-
}
141141
});

0 commit comments

Comments
 (0)