Skip to content

Commit

Permalink
Fail stencil bundle on Webpack compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jbruni committed Feb 20, 2019
1 parent c8001cc commit 0e3d934
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Draft
- Resolve add to cart modal mobile isssue. [#1450](https://github.com/bigcommerce/cornerstone/pull/1450)
- Fail stencil bundle on Webpack compile errors [#1457](https://github.com/bigcommerce/cornerstone/pull/1457)

## 3.2.1 (2019-02-15)
- Added package-lock.json. [#1441](https://github.com/bigcommerce/cornerstone/pull/1441)
Expand Down
14 changes: 12 additions & 2 deletions stencil.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ function development() {
var devConfig = require('./webpack.dev.js');

// Rebuild the bundle once at bootup
webpack(devConfig).watch({}, err => {
webpack(devConfig).watch({}, (err, stats) => {
if (err) {
console.error(err.message, err.details);
}

if (stats.hasErrors()) {
console.error(stats.toString({ all: false, errors: true, colors: true }));
}

process.send('reload');
});
}
Expand All @@ -42,13 +46,19 @@ function development() {
function production() {
var prodConfig = require('./webpack.prod.js');

webpack(prodConfig).run(err => {
webpack(prodConfig).run((err, stats) => {
if (err) {
console.error(err.message, err.details);
process.exit(1);
return;
}

if (stats.hasErrors()) {
console.error(stats.toString({ all: false, errors: true, colors: true }));
process.exit(1);
return;
}

process.send('done');
});
}
Expand Down

0 comments on commit 0e3d934

Please sign in to comment.