Mark folder as Resource Root is not persistent

Answered

I have React Native project in Intellij IDEA Ultimate. I've found that in order for IDEA to track imports properly I have to mark a parent directory as Resource Root. This works just fine.

However the code is managed in git and if I change branches the parent directory is no longer marked as Resource Root and I have to manually re-mark it each time. I've checked and .idea and .iml files are in my .gitignore. Switching branches is not pulling down a new project file and thus overwriting my Resource Root marking.

Is there a way I can mark a directory as Resource Root and have it be persistent? Thanks.

0
2 comments

Did you try to diff the project files to check why it happens? This information is stored in the .iml file. Does it remain the same?

In case the project is imported from Gradle/Maven, source roots information will be regenerated.

0

It seems even if you check in the .iml file to git, then clone, open the project, IDEA does not scan the .iml file and mark the directories in the GUI.

0

Please sign in to leave a comment.