Macil / flow-copy-source

Script to copy javascript files and append ".flow" to the filename
MIT License
173 stars 13 forks source link

Respect and bake-in .flowconfig name_mapper settings #9

Open gausie opened 6 years ago

gausie commented 6 years ago

If you use webpack or babel to (for example) import some png files into your project, you can then use name_mapper in your .flowconfig so Flow better understands what's going on.

It would be great if flow-copy-source could replace image imports with an import of the mapped stub when generating .js.flow files.

Macil commented 6 years ago

Assuming you are using flow-copy-source to generate .flow files before publishing to npm: ignoring Flow, does the consumer of your module have to configure anything specially to deal with the png imports in your code? For example, does your module require the consumer to configure webpack in a specific way to allow png imports? (In this case, it seems like it's not much more to ask them to edit their .flowconfig file too.) Or does your compilation process remove the png imports before publishing to npm? (In this case, it seems natural that flow-copy-source or something else performs a similar operation on the .flow files too.)