Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mark node_modules as excluded by default in webstorm 10

Tags:

webstorm

Every time I download a project from github I run npm install, which triggers a reindex on the to-be-created node_modules folder. This indexing slows my computer way down. An ugly workaround is to create an empty node_modules folder, exclude it, then run npm install. How can i disable indexing for the node_modules folder in EVERY project by default? Webstorm does this for Meteor projects with .meteor/local, so I assume it's possible.

like image 929
Matt K Avatar asked Nov 01 '15 17:11

Matt K


2 Answers

We usually suggest excluding this folder if it's used for auxiliary purposes (running grunt/gulp/karma, etc.). But we can't exclude it by default, as users developing Node.js applications usually need to have completion/types resolving working for node_modules.

If you need it being excluded from all your projects by default, just add node_modules to 'Ignore files and folders' list in Settings/Editor/File types

Update: since 2016.x, node_modules are auto-excluded by default. Direct dependencies listed in package.json are set up as a JavaScript Library for completion

like image 193
lena Avatar answered Dec 03 '22 17:12

lena


webstorm treats node_module directory as library root, so there is no mark directory as menu when right click on it. we can change it to a plain directory by delete a config item whose type is project from preference > Language & Framework > Javascript > Libraries, then mark the node_module directory as excluded.

like image 25
Shawn Wang Avatar answered Dec 03 '22 16:12

Shawn Wang