Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom exclude node_modules folder from search

How to exclude node_modules folder from Atom searches "Find in project" after you have put node_modules inside your .gitignore file? Does atom require that the project actually has a git repository, or should the .gitignore be enough for Atom to exclude the folder?

My .gitignore looks like this:

.DS_STORE *.log  node_modules  dist coverage 
like image 859
Ville Miekk-oja Avatar asked Jun 29 '16 13:06

Ville Miekk-oja


People also ask

Should I exclude Node_modules?

You must exclude node_modules , even though the folder is outside the src folder. That's because those packages are imported (using import ) inside the files (a.k.a modules) that are placed inside the included src folder.


2 Answers

Steps

  1. Launch atom
  2. From the menu: edit > preferences (atom > prefernces on Mac)
  3. From the side menu, click the button "Open Config Folder"

Now a new atom IDE should open.

  1. Open the file "config.cson"
  2. Add ignoredNames: ["node_modules"] under core

Example of a config.cson

"*":   core:     ignoredNames: [       ".git"       "node_modules"     ]   editor: {}   minimap:     plugins:       "highlight-selected": true       "highlight-selectedDecorationsZIndex": 0   welcome:     showOnStartup: false 

Hope this helps

like image 71
aSmater.Me Avatar answered Sep 20 '22 15:09

aSmater.Me


In the "File/directory pattern" field of the search use an exclamation mark followed by the name of the directory you want to ignore:

enter image description here

like image 42
Rodrigo Pinto Avatar answered Sep 20 '22 15:09

Rodrigo Pinto