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

Commit

Permalink
add webpack-fail-plugin and make the build fail on emitError
Browse files Browse the repository at this point in the history
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
  • Loading branch information
giogonzo committed Jul 8, 2017
1 parent b43c38f commit a8c3db0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"typescript": "^2.4.1",
"virtual-module-webpack-plugin": "^0.2.1",
"webpack": "^3.1.0",
"webpack-dev-server": "^2.5.1"
"webpack-dev-server": "^2.5.1",
"webpack-fail-plugin": "^1.0.6"
}
}
4 changes: 3 additions & 1 deletion src/scripts/webpack/webpack.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import path from 'path';
import CompressionPlugin from 'compression-webpack-plugin';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import webpackFailPlugin from 'webpack-fail-plugin';
import { getHtmlPluginConfig } from './util';
import WebpackBase from './webpack.base';

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

if (NODE_ENV === 'production') {
Expand Down

0 comments on commit a8c3db0

Please sign in to comment.