Skip to content

Commit

Permalink
Exit on build error when running parcel build (#176)
Browse files Browse the repository at this point in the history
* exit

* use exitCode for gracefull exiting
  • Loading branch information
Jasper De Moor authored and devongovett committed Dec 11, 2017
1 parent 644f195 commit 34b84e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ class Bundler extends EventEmitter {
if (this.hmr) {
this.hmr.emitError(err);
}

if (process.env.NODE_ENV === 'production') {
process.exitCode = 1;
}
} finally {
this.pending = false;
this.emit('buildEnd');
Expand Down

0 comments on commit 34b84e4

Please sign in to comment.