Skip to content

Commit

Permalink
Fail build on error, and print a useful message (#13255)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsimha authored Feb 5, 2018
1 parent a8e4f9e commit 515e812
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -992,11 +992,10 @@ function compileJs(srcDir, srcFilename, destDir, options) {
const startTime = Date.now();
return toPromise(bundler.bundle()
.on('error', function(err) {
if (err instanceof SyntaxError) {
console.error(red('Syntax error: ' + err.message));
} else {
console.error(red(err.message));
}
// Drop the node_modules call stack, which begins with ' at'.
const message = err.stack.replace(/ at[^]*/, '').trim();
console.error(red(message));
process.exit(1);
})
.pipe(lazybuild())
.pipe($$.rename(destFilename))
Expand Down

0 comments on commit 515e812

Please sign in to comment.