Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
excluding node_modules from Sublime Text 2
// Place user-specific overrides in this file, to ensure they're preserved
// when upgrading
{
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"]
}
@davewoodall

This comment has been minimized.

Copy link

davewoodall commented Aug 23, 2013

Thanks for posting!

@zjhiphop

This comment has been minimized.

Copy link

zjhiphop commented Dec 10, 2013

Useful!

@artem1

This comment has been minimized.

Copy link

artem1 commented Feb 13, 2014

Thx

@rozap

This comment has been minimized.

Copy link

rozap commented May 22, 2014

thanks!

@redbar0n

This comment has been minimized.

Copy link

redbar0n commented Jul 3, 2014

does this actually remove it from the project wide search result ("find in files") ?
It doesn't in ST3 :(

@jedmao

This comment has been minimized.

Copy link

jedmao commented Dec 31, 2014

@redbar0n it's working for me in ST3.

@Ibuprofen

This comment has been minimized.

Copy link

Ibuprofen commented Jan 5, 2015

Working in ST3 for me in the file:
~/Library/Application Support/Sublime Text 3/Packages/User/Preferences.sublime-settings

Thanks!

@jirivrany

This comment has been minimized.

Copy link

jirivrany commented Jan 29, 2015

Thanks, very useful.

@pbojinov

This comment has been minimized.

Copy link

pbojinov commented Feb 3, 2015

thank you, having ST3 searching bower_components and node_modules has been driving me crazy

@rootion

This comment has been minimized.

Copy link

rootion commented Feb 3, 2015

super useful, thanks!

@dominic-ew

This comment has been minimized.

Copy link

dominic-ew commented Feb 5, 2015

%project_path%/_nogit/project.sublime-project
{
"folders":
[
{
"follow_symlinks": true,
"path": "../",
"folder_exclude_patterns": [".svn", ".git", ".hg", "CVS", "node_modules"],
"file_exclude_patterns": [],
}
]
}

@Ugarz

This comment has been minimized.

Copy link

Ugarz commented Feb 10, 2015

I was looking something like this for a while, thanks !

@AoDev

This comment has been minimized.

Copy link

AoDev commented Apr 10, 2015

Thank you. The only problem of this method is that it also removes these folders from the sidebar and I regularly check node modules source code when I don't find what I need in the documentation. I access them through the sidebar usually :P

@hfuentes

This comment has been minimized.

Copy link

hfuentes commented Apr 15, 2015

Thanks, very useful.

@bartocc

This comment has been minimized.

Copy link

bartocc commented Apr 16, 2015

I'm in line with @AoDev

It is a shame loosing the node_modules folders in the sidebar in the sake of search speed.

I wonder how vim and other text editors handle this

@joshuabremer

This comment has been minimized.

Copy link

joshuabremer commented Apr 22, 2015

Thank you! 👍

@deostroll

This comment has been minimized.

Copy link

deostroll commented Jun 22, 2015

Where do you add this file? I use sublime on a windows machine...

@WORMSS

This comment has been minimized.

Copy link

WORMSS commented Jul 7, 2015

@deostroll %appdata%\Sublime Text 3\Packages\User\Preferences.sublime-settings

@adam-beck

This comment has been minimized.

Copy link

adam-beck commented Jul 16, 2015

Does anybody have a solution for including directories in the sidebar but not in searches?

@nitriques

This comment has been minimized.

Copy link

nitriques commented Aug 20, 2015

@adam-beck been loosing a lot of time over this. And this solution did not worked for me: https://twitter.com/wesbos/status/294167742926446593

@rvanmil

This comment has been minimized.

Copy link

rvanmil commented Aug 26, 2015

Thanks!

@merwan7

This comment has been minimized.

Copy link

merwan7 commented Sep 28, 2015

Oh my god THANK YOU.

@gabrielpconceicao

This comment has been minimized.

Copy link

gabrielpconceicao commented Nov 12, 2015

Thanks! 👍

@artemsvirskyi

This comment has been minimized.

@amplicity

This comment has been minimized.

Copy link

amplicity commented Jan 6, 2016

thanks!

@olthof

This comment has been minimized.

Copy link

olthof commented Jan 28, 2016

Thanks for sharing!

@petsto

This comment has been minimized.

Copy link

petsto commented Feb 23, 2016

Thanks for sharing!

@gillytech

This comment has been minimized.

Copy link

gillytech commented Feb 24, 2016

Thanks for sharing!

@lawenliu

This comment has been minimized.

Copy link

lawenliu commented Feb 28, 2016

Thanks~

@gaupoit

This comment has been minimized.

Copy link

gaupoit commented Mar 11, 2016

Thanks bro

@dannyid

This comment has been minimized.

Copy link

dannyid commented Mar 29, 2016

🙏

@serchavalos

This comment has been minimized.

Copy link

serchavalos commented Mar 31, 2016

❤️

@dikiaap

This comment has been minimized.

Copy link

dikiaap commented Apr 6, 2016

Thanks, more fast.

@blainegarrett

This comment has been minimized.

Copy link

blainegarrett commented Apr 7, 2016

Thank you.

@sagivo

This comment has been minimized.

Copy link

sagivo commented Apr 12, 2016

👍

@Avcajaraville

This comment has been minimized.

Copy link

Avcajaraville commented Apr 25, 2016

Thank you for sharing !

What @artemsvirskyi suggest worked for me: excluding folder from search, but not from sidebar tree.

Thanks again !

@eliseumds

This comment has been minimized.

Copy link

eliseumds commented May 19, 2016

So

{
  "binary_file_patterns": ["node_modules/"]
}

(with the slash in the end) is the way to go? Works for me on ST3.

@baraamashaal

This comment has been minimized.

Copy link

baraamashaal commented Jun 3, 2016

Thank you for sharing !

@badalsurana

This comment has been minimized.

Copy link

badalsurana commented Jul 8, 2016

Thank you

@robsonbittencourt

This comment has been minimized.

Copy link

robsonbittencourt commented Aug 21, 2016

Thank you.

@jeezlee

This comment has been minimized.

Copy link

jeezlee commented Aug 31, 2016

"binary_file_patterns": ["node_modules/"]
Works for me on ST3!

@maxime1992

This comment has been minimized.

Copy link

maxime1992 commented Oct 16, 2016

Thanks, awesome

@Committing

This comment has been minimized.

Copy link

Committing commented Nov 4, 2016

Thanks

@YuryDG

This comment has been minimized.

Copy link

YuryDG commented Dec 12, 2016

Thanks for sharing !

@rafaelcamargo

This comment has been minimized.

Copy link

rafaelcamargo commented Jan 19, 2017

🎉
Thanks!

@victusfate

This comment has been minimized.

@wojciechmorawski

This comment has been minimized.

Copy link

wojciechmorawski commented Mar 25, 2017

@victusfate

This comment has been minimized.

Copy link

victusfate commented Apr 14, 2017

Update sometimes I want to search node_modules sometimes I don't.
Just update the Where path:

  *.js,-*/node_modules/*
@sofakeer

This comment has been minimized.

Copy link

sofakeer commented May 1, 2017

Thanks!

@rafaelcardoso

This comment has been minimized.

Copy link

rafaelcardoso commented Jul 13, 2017

Thank you for this!!

@prateekm33

This comment has been minimized.

Copy link

prateekm33 commented Jul 19, 2017

@artemsvirskyi thanks!

@mrGibi

This comment has been minimized.

Copy link

mrGibi commented Jul 28, 2017

Thanks!

@rhondarobot

This comment has been minimized.

Copy link

rhondarobot commented Nov 13, 2017

Thanks!

@PierBover

This comment has been minimized.

Copy link

PierBover commented Jan 29, 2018

My CPU gives her regards!

@zerodois

This comment has been minimized.

Copy link

zerodois commented Feb 14, 2018

Thaaaanks!

@BenChirlin

This comment has been minimized.

Copy link

BenChirlin commented Mar 24, 2018

@jeezlee fix worked best for me. Won't search but can still see in sidebar.

"binary_file_patterns": ["node_modules/"]

@mantuonweb

This comment has been minimized.

Copy link

mantuonweb commented Apr 3, 2018

Thanks! :)

@imsinu9

This comment has been minimized.

Copy link

imsinu9 commented Apr 12, 2018

Thanks that worked 👍

@agdiaz

This comment has been minimized.

Copy link

agdiaz commented May 28, 2018

Thanks!!!

@moffeemoffee

This comment has been minimized.

Copy link

moffeemoffee commented Sep 5, 2018

Thank you!

@karacas

This comment has been minimized.

Copy link

karacas commented Jan 13, 2019

Nice!

@abhijitmamarde

This comment has been minimized.

Copy link

abhijitmamarde commented Sep 13, 2019

Great! still works!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.