Skip to content

Commit

Permalink
fix: fail build if comilation.stats.errors is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Mar 26, 2020
1 parent d6f430b commit 86a95cd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ if (command === 'build') {
build(argv).then(
// eslint-disable-next-line promise/always-return
({ stats, options }) => {
// eslint-disable-next-line promise/always-return
if (stats.compilation.errors && stats.compilation.errors.length) {
spinner.fail(`Failed to build pages`);
console.log(JSON.stringify(stats.compilation.errors));
process.exit(1);
}

spinner.succeed(
`Successfully built pages in ${chalk.bold(
String(stats.endTime - stats.startTime)
Expand Down

0 comments on commit 86a95cd

Please sign in to comment.