Skip to content

webpack --watch process terminates  #7

Description

@basti1302

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
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions