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

Fail stencil bundle on Webpack compile errors #1457

Merged
merged 2 commits into from
Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
22 changes: 20 additions & 2 deletions stencil.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,19 @@ 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 }));
}

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

process.send('reload');
});
}
Expand All @@ -42,13 +50,23 @@ 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;
}

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

process.send('done');
});
}
Expand Down
4 changes: 2 additions & 2 deletions webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ module.exports = {
},
performance: {
hints: 'warning',
maxAssetSize: 1024 * 150,
maxEntrypointSize: 1024 * 150,
maxAssetSize: 1024 * 300,
maxEntrypointSize: 1024 * 300,
},
plugins: [
new CleanPlugin(['assets/dist'], {
Expand Down
3 changes: 3 additions & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ const webpack = require('webpack'),
module.exports = merge(commonConfig, {
devtool: 'inline-source-map',
mode: 'development',
performance: {
hints: false,
},
});