shaketbaby / directory-named-webpack-plugin

A Webpack plugin that treats a file with the name of directory as the index file
MIT License
182 stars 17 forks source link

Have you gotten this working with flow? #16

Closed 0xjocke closed 7 years ago

shaketbaby commented 7 years ago

I've never used flow, what's the issue?

shaketbaby commented 7 years ago

Closing as can't do much without further info.

Rodeoclash commented 6 years ago

The issue here with flow is it doesn't use the same resolvers as webpack / this library. It might be possible with use of flows name mapper config to produce some regex that would achieve the same effect in resolving files.

todesstoss commented 6 years ago

same here, can't use flow with this import: [flow] ./components/Component (Required module not found) while my file is in ./components/Component/Component.js

todesstoss commented 6 years ago

I hope it will help someone:

you can add this to your .flowconfig

[options]
module.name_mapper='\(/[a-zA-Z]+$\)' -> '\1\1'

I'm, also using aliases for my src directory, and I can't understand how to pipe few regexp to one import string. The config above works well for relative imports, without aliases.