Fix webpack exit code to actually work.
Webpack does not return non-zero values are failure. This breaks most build systems.pull/260/head
parent
984c3efaef
commit
3b583a8da2
|
@ -7,6 +7,7 @@ var package = require('../package.json');
|
||||||
var dependencies = package.dependencies;
|
var dependencies = package.dependencies;
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
|
bail: true,
|
||||||
devtool: 'hidden-source-map',
|
devtool: 'hidden-source-map',
|
||||||
entry: {
|
entry: {
|
||||||
app: path.resolve(__dirname, '..', 'src', 'index.js'),
|
app: path.resolve(__dirname, '..', 'src', 'index.js'),
|
||||||
|
@ -91,6 +92,16 @@ var config = {
|
||||||
new webpack.optimize.CommonsChunkPlugin({
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
names: ['vendor', 'manifest'],
|
names: ['vendor', 'manifest'],
|
||||||
}),
|
}),
|
||||||
|
function() { /* Webpack does not exit with non-zero status if error. */
|
||||||
|
this.plugin("done", function(stats) {
|
||||||
|
if (stats.compilation.errors && stats.compilation.errors.length && process.argv.indexOf("--watch") == -1) {
|
||||||
|
console.log(stats.compilation.errors.toString({
|
||||||
|
colors: true
|
||||||
|
}));
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
],
|
],
|
||||||
postcss: require('./postcss'),
|
postcss: require('./postcss'),
|
||||||
target: 'web',
|
target: 'web',
|
||||||
|
|
Loading…
Reference in New Issue