Thanks to visit codestin.com Credit goes to webpack.js.org
The NoEmitOnErrorsPlugin allows you to avoid emitting assets when there are any errors. Enabled by default, you can disable using optimization.emitOnErrors
NoEmitOnErrorsPlugin
optimization.emitOnErrors
webpack.config.js
module.exports = { plugins: [new webpack.NoEmitOnErrorsPlugin()], };