Excluding directories globally Follow
I'm trying to configure my environment to exclude dist + target directories across all my projects.
I know I can go to each project and exclude it manually, but I want to automatically exclude these directories without specifying it.
is that possible ?
Please sign in to leave a comment.
Please follow https://youtrack.jetbrains.com/issue/IDEA-150784 for updates.
Preferences | Editor | File Types,
Ignore files and foldersallows to ignore files/folders globally. But these folders are excluded completely - not shown in Project view, etc.
@Elena Pogorelova Thanks for the quick reply. Sorry, I didn't read the last sentence clearly, you did tell the differences.
Maybe what I was trying to express is, the differences between "Ignore files and folders" and "exclude" makes it not fully work well in some cases, and I really hope to have the feature "configure exclude directory globally".
This is my case:
I tried the option you mentioned to "ignore" node_modules completely. The indexing is much faster(about 3 minutes), but I often need to view code inside node_modules, I can't do it now.
After several days of investigation, I found a workaround now, it's working but very hacky:
Open the project with webstorm, and when it's blocked at "indexing", kill webstorm. Then go to the ".idea" directory and open the "project.iml" file. Modify the xml file, add an exclude pattern item for "node_modules" like this: `<excludePattern pattern="node_modules" />`, then open the project with webstorm again and everything will work well.
It's working but very inconvenient, that's why I really hope to configure "exclude" globally.
@Nowindlee please read my comment above - didn't I mention there that ignored folders, unlike excluded ones, are excluded completely - not shown in Project view, etc.?
I ended up doing `find . -name target -type d | pbcopy` and vim-macroing those into the project's iml file as `<excludeFolder url="file://$MODULE_DIR$/(line of output here)" />`
Would be great if intellij could support the same sort of `"**/target"` glob that vscode does.
@Mat Schaffer,I ended up writing a script file to do the same.
I'm thinking if I should switch to VS code now
One of my coworkers mentioned https://youtrack.jetbrains.com/issue/IDEA-127753#focus=Comments-27-2365949.0-0 which says `*target` might work too.
I haven't tried it yet and instead have opted to give VSCode a go for the week.