Reputation: 4857
How do I make my webpack build fail if scripts.js
throws an error? Adding --bail
as a flag or as a configuration option does not work.
// webpack.config.js
const SynchronizableShellPlugin = require('webpack-synchronizable-shell-plugin');
...
bail: true, // this does not work like I expect it to
plugins: {
new SynchronizableShellPlugin({
onBuildStart: {
scripts: ['node script.js'],
blocking: true
}
}),
}
...
Upvotes: 1
Views: 676
Reputation: 26
The issue is that this specific plugin does not throw an error in case of script failure. You can use different plugin, e.g. pre-build-webpack.
Upvotes: 1