Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Commit a8c3db0

Browse files
committed
add webpack-fail-plugin and make the build fail on emitError
reading docs and some issue discussions, this should be the default behavior with webpack >= 2, but it doesn't seem to work without adding webpack-fail-plugin See e.g. TypeStrong/ts-loader#108
1 parent b43c38f commit a8c3db0

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"typescript": "^2.4.1",
8585
"virtual-module-webpack-plugin": "^0.2.1",
8686
"webpack": "^3.1.0",
87-
"webpack-dev-server": "^2.5.1"
87+
"webpack-dev-server": "^2.5.1",
88+
"webpack-fail-plugin": "^1.0.6"
8889
}
8990
}

src/scripts/webpack/webpack.build.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from 'path';
33
import CompressionPlugin from 'compression-webpack-plugin';
44
import ExtractTextPlugin from 'extract-text-webpack-plugin';
55
import HtmlWebpackPlugin from 'html-webpack-plugin';
6+
import webpackFailPlugin from 'webpack-fail-plugin';
67
import { getHtmlPluginConfig } from './util';
78
import WebpackBase from './webpack.base';
89

@@ -13,7 +14,8 @@ export default ({ config, paths, NODE_ENV, ...options }) => {
1314
// cause failed production builds to fail faster
1415
new webpack.NoEmitOnErrorsPlugin(),
1516
new HtmlWebpackPlugin(getHtmlPluginConfig(NODE_ENV, config.title)),
16-
new ExtractTextPlugin({ filename: 'style.[hash].min.css' })
17+
new ExtractTextPlugin({ filename: 'style.[hash].min.css' }),
18+
webpackFailPlugin
1719
];
1820

1921
if (NODE_ENV === 'production') {

0 commit comments

Comments
 (0)