admin管理员组文章数量:1398827
Is there a way to configure a WebStorm project that so node_modules
is selected as library root
but that it's also excluded from indexing?
I swear I saw a project that indicated node_modules
was both library root
and excluded
but I can't figure out how to set that up. Anybody know how?
Is there a way to configure a WebStorm project that so node_modules
is selected as library root
but that it's also excluded from indexing?
I swear I saw a project that indicated node_modules
was both library root
and excluded
but I can't figure out how to set that up. Anybody know how?
2 Answers
Reset to default 7No, it's impossible. Because library root
means "index a part of node_modules corresponding to direct dependencies from package.json, and exclude the rest part of it (i.e. indirect dependencies - dependencies of dependencies)" and excluded
means "exclude the whole node_modules (i.e. both direct and indirect dependencies)".
If you want to have node_modules excluded
, just go to "Settings | Languages & Frameworks | JavaScript | Libraries" and unselect corresponding node_modules library.
At this time, it is possible to exclude a library root
folder.
Configuring a library root
folder is explained in this answer. Here is the relevant part:
Select Preferences | Languages & Frameworks | JavaScript | Libraries and click Add. Select the path you want to add and the folder will be marked as library root.
Then, the library root
folder can be excluded.
Excluded directories are hidden in the project's tree (unless you asked to show excluded folders, of course). Phpstorm still references classes and functions in the library root
folder. Javascript's require
and import
still work and navigating to a file is possible.
版权声明:本文标题:javascript - WebStorm - make node_modules "library root" but also exclude it from indexing - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744611709a2615696.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论