How to exclude node_modules folders on any level in the project

I use the monorepo approach (https://lernajs.io/ , works as an advanced "npm link", so you can create modules anywhere in the project and manage their dependencies), which creates node_modules with the symlinks on different levels inside the project.

, which creates node_modules with the symlinks on different levels inside the project.

When I search for the content of the file, which is symlinked in other node_modules (e.g. project module A has a dependency on B, and C has a dependency on B ):

1) the search shows all the files: http://imgur.com/BRlhOeq

2) open by file name also includes all of them: http://imgur.com/GxtY1b0

I tried using <excludeFolder url="node_modules" /> in *.iml file and it used to help, but looks like doesn't work anymore.

Is it a correct way to exclude the folder by a name on any level in the project, or there advanced techniquest with something like <exclude Patter /> or similar?

Thanks.

2 comments
Comment actions Permalink

> there advanced techniquest with something like <exclude Patter /> or similar?

 

You can try using Exclude files field in Settings | Directories - see shttps://www.jetbrains.com/help/webstorm/2017.2/directories.html. Note that exclusion by relative path pattern isn't supported yet - see https://youtrack.jetbrains.com/issue/IDEA-173675.

Note also that you can use Ignore files and folders option to exclude certain files by name ( see https://youtrack.jetbrains.com/issue/IDEA-127753#comment=27-868409 )

 

And one more note: symlinked folders are indexed even when marked excluded - please follow https://youtrack.jetbrains.com/issue/IDEA-140916 for updates. In general, WebStorm doesn't play well with symlinks, they cause various issues, for example, fsnotifier tool we use to synchronize the IDE virtual file system with external changes doesn't support them (https://youtrack.jetbrains.com/issue/IDEA-65174). Cyclic links can also cause performance issues when indexing. So I'd suggest to avoid using them if possible

0
Comment actions Permalink

Thanks for the detailed answer, Elena.

Just subscribed to the issue which will allow excluding by a pattern,

meanwhile will try to avoid cyclic links, as my IDEA just stuck.

Cheers.

0

Please sign in to leave a comment.