webpack-fail-plugin
raw JSON → 2.0.0 verified Sat Apr 25 auth: no javascript deprecated
Webpack plugin that ensures the build process exits with a non-zero exit code when compilation errors occur in single-run mode. Current version 2.0.0 (last release) is deprecated because Webpack 2+ natively exits with an error code on failures. This plugin was a workaround for Webpack 1.x where errors did not propagate correctly. No active development; the package is effectively in maintenance mode for legacy Webpack 1.x projects. For Webpack 2+, the built-in behavior should be sufficient.
Common errors
error Error: webpack-fail-plugin is not supported for webpack 2+ ↓
cause Plugin is deprecated and not tested with Webpack 2+.
fix
Remove the plugin; Webpack 2+ handles exit codes natively.
Warnings
deprecated Plugin is deprecated; Webpack 2+ natively returns non-zero exit code on compilation errors. ↓
fix Remove the plugin for Webpack 2+ projects; for Webpack 1.x, it may still be needed.
gotcha Does not support Webpack 2+ officially; may cause unexpected behavior if used with newer Webpack versions. ↓
fix Do not use with Webpack 2+ unless you experience a bug; prefer native exit behavior.
Install
npm install webpack-fail-plugin yarn add webpack-fail-plugin pnpm add webpack-fail-plugin Imports
- failPlugin
var failPlugin = require('webpack-fail-plugin'); - default import
import failPlugin from 'webpack-fail-plugin';
Quickstart
var failPlugin = require('webpack-fail-plugin');
module.exports = {
entry: './index.js',
output: { filename: 'bundle.js' },
plugins: [ failPlugin ]
};