Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exit production build if any errors are in build stats #859

Merged
merged 2 commits into from
Oct 7, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/react-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ function build(previousSizeMap) {
process.exit(1);
}

// Webpack may swallow uglify errors even with bail:true
if (stats.compilation.errors.length) {
console.error(chalk.red('Error(s) occurred during the production build:'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be the same message that we use for failed compilation in start.js? And would be nice to fix it up for the other (different) message in this file so they are all consistent.

stats.compilation.errors.forEach(err => console.error(chalk.red(err.message || err)));
process.exit(1);
}

console.log(chalk.green('Compiled successfully.'));
console.log();

Expand Down