Skip to content

Commit

Permalink
factor into one if
Browse files Browse the repository at this point in the history
  • Loading branch information
joscha authored Jun 28, 2017
1 parent 302f157 commit 9c57ae0
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions app/react/src/server/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,10 @@ 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) {
logger.error('Failed to build the storybook');
logger.error(err.message);
}
if (stats.hasErrors()) {
logger.error('Failed to build the storybook');
stats.toJson().errors.forEach(function (e) {
return logger.error(e);
});
}
if (err || stats.hasErrors()) {
logger.error('Failed to build the storybook');
err && logger.error(err.message);
stats.hasErrors() && stats.toJson().errors.forEach(e => logger.error(e));
process.exit(1);
}

Expand Down

0 comments on commit 9c57ae0

Please sign in to comment.