Webpack now fails on error

This commit is contained in:
József Farkas
2016-08-15 22:13:28 +02:00
parent ee5eb29f2a
commit 1cb95840c9
4 changed files with 12 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
// var webpack = require("webpack");
var webpackFailPlugin = require('webpack-fail-plugin');
module.exports = {
entry: {
@@ -24,7 +25,8 @@ module.exports = {
]
},
plugins: [
// new webpack.optimize.UglifyJsPlugin({ minimize: true })
// new webpack.optimize.UglifyJsPlugin({ minimize: true }),
webpackFailPlugin
],
node: {
fs: "empty"

View File

@@ -24,7 +24,11 @@ gulp.task('watch', function () {
gulp.task('webpack', function () {
return gulp.src('./src/boot.ts')
.pipe(webpackStream(require('./webpack.config.js')))
.pipe(webpackStream(require('./webpack.config.js'))
.on('error', function (error) {
// console.error(error.message);
this.emit('end');
}))
.pipe(gulp.dest('build/'));
});

View File

@@ -22,6 +22,7 @@
"tslint": "^3.14.0",
"webpack": "^1.13.1",
"webpack-dev-server": "^1.14.1",
"webpack-fail-plugin": "^1.0.5",
"webpack-stream": "^3.2.0",
"webpack-svgstore-plugin": "^2.2.2",
"yargs": "^4.8.1"

View File

@@ -1,5 +1,6 @@
// var webpack = require("webpack");
var SvgStore = require('webpack-svgstore-plugin');
var webpackFailPlugin = require('webpack-fail-plugin');
module.exports = {
entry: ['es6-shim', 'zone.js', 'reflect-metadata', './src/boot.ts'],
@@ -57,7 +58,8 @@ module.exports = {
]
}
}
)
),
webpackFailPlugin
]
}