Skip to content

Commit

Permalink
Merge pull request #1372 from storybooks/joscha/error-non-zero-on-sta…
Browse files Browse the repository at this point in the history
…ts-errors

fix: Fail on transpilation errors
  • Loading branch information
shilman authored Jun 28, 2017
2 parents 768f9ff + 50aac05 commit afc12f9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/react/src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ if (program.staticDir) {
// compile all resources with webpack and write them to the disk.
logger.log('Building storybook ...');
webpack(config).run((err, stats) => {
if (err) {
if (err || stats.hasErrors()) {
logger.error('Failed to build the storybook');
logger.error(err.message);
// eslint-disable-next-line no-unused-expressions
err && logger.error(err.message);
// eslint-disable-next-line no-unused-expressions
stats.hasErrors() && stats.toJson().errors.forEach(e => logger.error(e));
process.exit(1);
}

Expand Down

0 comments on commit afc12f9

Please sign in to comment.