Skip to content
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
Prev Previous commit
Match console error output in start.js
  • Loading branch information
Patrick Dillon committed Oct 7, 2016
commit 93e4c291daaa99801a21bf0f7f2a453d0c412307
17 changes: 12 additions & 5 deletions packages/react-scripts/scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,27 @@ function printFileSizes(stats, previousSizeMap) {
});
}

// Print out errors
function printErrors(summary, errors) {
console.log(chalk.red(summary));
console.log();
errors.forEach(err => {
console.log(err.message || err);
console.log();
});
}

// Create the production build and print the deployment instructions.
function build(previousSizeMap) {
console.log('Creating an optimized production build...');
webpack(config).run((err, stats) => {
if (err) {
console.error('Failed to create a production build. Reason:');
console.error(err.message || err);
printErrors('Failed to compile.', [err]);
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:'));
stats.compilation.errors.forEach(err => console.error(chalk.red(err.message || err)));
printErrors('Failed to compile.', stats.compilation.errors);
process.exit(1);
}

Expand Down