Skip to content

Commit a34532a

Browse files
pksunkaraLinusBorg
authored andcommitted
Return exit code 1 when npm run build fails (#854)
1 parent d8a9340 commit a34532a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

template/build/build.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
2626
chunkModules: false
2727
}) + '\n\n')
2828

29+
if (stats.hasErrors()) {
30+
console.log(chalk.red(' Build failed with errors.\n'))
31+
process.exit(1)
32+
}
33+
2934
console.log(chalk.cyan(' Build complete.\n'))
3035
console.log(chalk.yellow(
3136
' Tip: built files are meant to be served over an HTTP server.\n' +

0 commit comments

Comments
 (0)