Custom Search - exclude all node_modules recusively



I would like to create a custom search in Find In Path , to exclude all node_modules recursively

I coudnt find an easy way , . The only way I can see , is going inside the project tree and excluding each node_module folder one by one.

This is a very hard way of doing it.

I would like a clever way of doing it . filter all folders called node_module recusively.

What pattern can I use.



Mark directory as/Excluded in folder right-click menu excludes the folder recursively - all files/subfolders of excluded folder are excluded.

Note also that you can create a custom scope with node_modules folder excluded recursively (Settings/Preferences | Appearance & Behavior | Scopes) and use this scope when searching in Find In Path


Hi Elena

I know what you said , this doesnt help me.

My problem is that I have a very large tree with many folders and sub folders and each one contains a node_module folder. I do not want to go and exclude each node_module folder seperately. I would like to just set the pattern that it ignores all node_module folders recursively


can't you create the corresponding scope then? Like !file[your_project]:*node_modules//*


Hi Elena

This is exactly what I was looking for 

Thanks thats great.


Doesn't work.... never have I ever had a software that was such a pain to search. A million features, but the important ones, don't work. I wish they'd stop spending time on features that no one uses and just fix the basic functionality!


You must have faced the issue because node_modules are only partially excluded - direct dependencies listed in package.json are added to JavaScript libraries and thus included.

Use In Project scope for searching. JavaScript libraries are only included when using Directory scope with corresponding folder selected, or when using custom scope with explicit filters


Please sign in to leave a comment.