Custom multiple main files in directory


I saw this feature in my react native project. There are two main files with the specific realization for platforms. This feature doesn't work without flow type checker.

I saw that flow use custom module system "haste" where described how to resolve module main file. I don't know how important it is.

I have a similar component structure in my web react project. Is it possible to tell IDE to resolve the main file like in react native project? With my custom main files.

I can't believe that it is impossible


No, this can't be done, sorry:( WebStorm expects an index.js file with module definition when using directory imports with relative paths


Is there any other case when I can see the "Choose Declaration" block? Using the module definition. Maybe with typescript, flow or webpack config. I don't know...


Please sign in to leave a comment.