With a configuration like
new FlowWebpackPlugin({
failOnError: true
})
and running webpack -w the webpack process is termintated when Flow errors exist with:
Flow validation failed.
Error: path/to/source.js:42
... more flow error details
I think this is due to the implementation of afterUserCallback in https://github.com/happylynx/flow-webpack-plugin/blob/master/src/index.js#L156-L168. There even is a comment stating
/*
* argument passed to callback() causes webpack to immediately stop, even in watch mode,
* don't emit assets, and set return code to 1
*/
There is only a check for plugin.options.failOnError. IMO the code would need to check if it is running in watch mode and just continue by calling webpackCallback() without arguments to avoid stopping the process.
Note: The behaviour is the same, even when explicitly specifying:
new FlowWebpackPlugin({
failOnError: true,
failOnErrorWatch: false
})
With a configuration like
and running
webpack -wthe webpack process is termintated when Flow errors exist with:I think this is due to the implementation of
afterUserCallbackin https://github.com/happylynx/flow-webpack-plugin/blob/master/src/index.js#L156-L168. There even is a comment statingThere is only a check for plugin.options.failOnError. IMO the code would need to check if it is running in watch mode and just continue by calling
webpackCallback()without arguments to avoid stopping the process.Note: The behaviour is the same, even when explicitly specifying: