report exit code on Errors

#729
This commit is contained in:
Tobias Koppers 2015-03-05 21:48:29 +01:00
parent a2af69056a
commit 0c8d94fa59
1 changed files with 5 additions and 0 deletions

View File

@ -167,4 +167,9 @@ var compiler = webpack(options, function(err, stats) {
lastHash = stats.hash;
process.stdout.write(stats.toString(outputOptions) + "\n");
}
if(!options.watch && stats.hasErrors()) {
process.on("exit", function() {
process.exit(2);
});
}
});