report error code when fatal error

fixes #181
This commit is contained in:
Tobias Koppers 2014-02-26 09:36:28 +01:00
parent 48aad3eeee
commit e8976b7c9d
1 changed files with 5 additions and 0 deletions

View File

@ -121,6 +121,11 @@ Error.stackTrackLimit = 30;
webpack(options, function(err, stats) { webpack(options, function(err, stats) {
if(err) { if(err) {
console.error(err.stack || err); console.error(err.stack || err);
if(!options.watch) {
process.on("exit", function() {
process.exit(1);
});
}
return; return;
} }
if(outputOptions.json) if(outputOptions.json)