Webpack plugin that forces the build process to exit with a non-zero exit code (status code 1) when compilation has any errors or warnings, superseding the default behavior where Webpack only fails on hard errors. Version 3.0.0 supports Webpack 4+. Useful for CI/CD pipelines to catch soft errors and warnings that would otherwise pass the build. A maintained fork of the abandoned webpack-fail-plugin.
npm install fail-on-errors-webpack-pluginVerified import paths — ran on the pinned version, not inferred.
Adds the FailOnErrorsPlugin to a Webpack config to fail the build on errors and warnings.
Pass an object { failOnErrors: boolean, failOnWarnings: boolean } instead of positional arguments.Test with Webpack 5; consider alternatives like webpack-stats-plugin or built-in emitError/emitWarning.
Set at least one option to true to get the desired behavior.
Be careful when combining with other plugins that manipulate exit codes.
Replace 'import FailOnErrorsPlugin from ...' with 'const FailOnErrorsPlugin = require(...)'
new FailOnErrorsPlugin({ failOnErrors: true, failOnWarnings: true })Run 'npm install fail-on-errors-webpack-plugin --save-dev'