flow-webpack-plugin
flow-webpack-plugin copied to clipboard
webpack --watch process terminates
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
})
👍 would be interested in this fix as well
@ericyliu The fix is available in PR #8 since early January but @happylynx seems to be gone. Maybe I should publish my fixed fork to npm.