Webpack 插件引发错误时无法生成网页包
如果Webpack 插件引发错误时无法生成网页包,webpack,Webpack,如果scripts.js抛出错误,如何使我的网页包构建失败?将--bail添加为标志或配置选项不起作用 // webpack.config.js const SynchronizableShellPlugin = require('webpack-synchronizable-shell-plugin'); ... bail: true, // this does not work like I expect it to plugins: { new SynchronizableShel
scripts.js
抛出错误,如何使我的网页包构建失败?将--bail
添加为标志或配置选项不起作用
// 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
}
}),
}
...
问题是这个特定的插件在脚本失败时不会抛出错误。您可以使用不同的插件,例如