-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
If you set flowPath to a globally installed flow without any local flow, this plugin still throws an error like:
Error: `flow` can't be found. Please either install it (`npm install --save-dev flow-bin`) or set `flowPath` option
at FlowWebpackPluginError (.../flow-webpack-plugin/dist/index.js:262:1)
at getLocalFlowPath (.../flow-webpack-plugin/dist/index.js:200:28)
at applyOptionsDefaults (.../flow-webpack-plugin/dist/index.js:254:19)
at new FlowWebpackPlugin (.../flow-webpack-plugin/dist/index.js:27:20)
...
.
I'd expect to be able to direct the plugin to my global flow and for this to all work without any local flow install.
I think the reason that it fails is that applyOptionDefaults calls getLocalFlowPath too eagerly. That function throws the exception but is always called---even when a flowPath is provided. Instead, it should be a thunk or something analogous and only called if flowPath is missing.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels