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"]
}
@fakefarm

This comment has been minimized.

Copy link

@fakefarm fakefarm commented Aug 23, 2013

Thanks for posting!

@zjhiphop

This comment has been minimized.

Copy link

@zjhiphop zjhiphop commented Dec 10, 2013

Useful!

@artem1

This comment has been minimized.

Copy link

@artem1 artem1 commented Feb 13, 2014

Thx

@rozap

This comment has been minimized.

Copy link

@rozap rozap commented May 22, 2014

thanks!

@redbar0n

This comment has been minimized.

Copy link

@redbar0n 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 jedmao commented Dec 31, 2014

@redbar0n it's working for me in ST3.

@Ibuprofen

This comment has been minimized.

Copy link

@Ibuprofen 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 jirivrany commented Jan 29, 2015

Thanks, very useful.

@pbojinov

This comment has been minimized.

Copy link

@pbojinov 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 rootion commented Feb 3, 2015

super useful, thanks!

@dominic-ew

This comment has been minimized.

Copy link

@dominic-ew 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 Ugarz commented Feb 10, 2015

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

@AoDev

This comment has been minimized.

Copy link

@AoDev 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 hfuentes commented Apr 15, 2015

Thanks, very useful.

@bartocc

This comment has been minimized.

Copy link

@bartocc 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 joshuabremer commented Apr 22, 2015

Thank you! 👍

@deostroll

This comment has been minimized.

Copy link

@deostroll 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 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 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 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 rvanmil commented Aug 26, 2015

Thanks!

@merwan7

This comment has been minimized.

Copy link

@merwan7 merwan7 commented Sep 28, 2015

Oh my god THANK YOU.

@gabrielpconceicao

This comment has been minimized.

Copy link

@gabrielpconceicao gabrielpconceicao commented Nov 12, 2015

Thanks! 👍

@artemsvirskyi

This comment has been minimized.

@amplicity

This comment has been minimized.

Copy link

@amplicity amplicity commented Jan 6, 2016

thanks!

@olthof

This comment has been minimized.

Copy link

@olthof olthof commented Jan 28, 2016

Thanks for sharing!

@petsto

This comment has been minimized.

Copy link

@petsto petsto commented Feb 23, 2016

Thanks for sharing!

@gillytech

This comment has been minimized.

Copy link

@gillytech gillytech commented Feb 24, 2016

Thanks for sharing!

@lawenliu

This comment has been minimized.

Copy link

@lawenliu lawenliu commented Feb 28, 2016

Thanks~

@gaupoit

This comment has been minimized.

Copy link

@gaupoit gaupoit commented Mar 11, 2016

Thanks bro

@dannyid

This comment has been minimized.

Copy link

@dannyid dannyid commented Mar 29, 2016

🙏

@serchavalos

This comment has been minimized.

Copy link

@serchavalos serchavalos commented Mar 31, 2016

❤️

@dikiaap

This comment has been minimized.

Copy link

@dikiaap dikiaap commented Apr 6, 2016

Thanks, more fast.

@blainegarrett

This comment has been minimized.

Copy link

@blainegarrett blainegarrett commented Apr 7, 2016

Thank you.

@sagivo

This comment has been minimized.

Copy link

@sagivo sagivo commented Apr 12, 2016

👍

@Avcajaraville

This comment has been minimized.

Copy link

@Avcajaraville 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 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 baraamashaal commented Jun 3, 2016

Thank you for sharing !

@badalsurana

This comment has been minimized.

Copy link

@badalsurana badalsurana commented Jul 8, 2016

Thank you

@robsonbittencourt

This comment has been minimized.

Copy link

@robsonbittencourt robsonbittencourt commented Aug 21, 2016

Thank you.

@jeeeez

This comment has been minimized.

Copy link

@jeeeez jeeeez commented Aug 31, 2016

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

@maxime1992

This comment has been minimized.

Copy link

@maxime1992 maxime1992 commented Oct 16, 2016

Thanks, awesome

@Committing

This comment has been minimized.

Copy link

@Committing Committing commented Nov 4, 2016

Thanks

@YuryDG

This comment has been minimized.

Copy link

@YuryDG YuryDG commented Dec 12, 2016

Thanks for sharing !

@rafaelcamargo

This comment has been minimized.

Copy link

@rafaelcamargo rafaelcamargo commented Jan 19, 2017

🎉
Thanks!

@victusfate

This comment has been minimized.

@wojciechmorawski

This comment has been minimized.

Copy link

@wojciechmorawski wojciechmorawski commented Mar 25, 2017

@victusfate

This comment has been minimized.

Copy link

@victusfate 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 sofakeer commented May 1, 2017

Thanks!

@rafaelcardoso

This comment has been minimized.

Copy link

@rafaelcardoso rafaelcardoso commented Jul 13, 2017

Thank you for this!!

@prateekm33

This comment has been minimized.

Copy link

@prateekm33 prateekm33 commented Jul 19, 2017

@artemsvirskyi thanks!

@mrGibi

This comment has been minimized.

Copy link

@mrGibi mrGibi commented Jul 28, 2017

Thanks!

@rhondarobot

This comment has been minimized.

Copy link

@rhondarobot rhondarobot commented Nov 13, 2017

Thanks!

@PierBover

This comment has been minimized.

Copy link

@PierBover PierBover commented Jan 29, 2018

My CPU gives her regards!

@zerodois

This comment has been minimized.

Copy link

@zerodois zerodois commented Feb 14, 2018

Thaaaanks!

@BenChirlin

This comment has been minimized.

Copy link

@BenChirlin 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 mantuonweb commented Apr 3, 2018

Thanks! :)

@imsinu9

This comment has been minimized.

Copy link

@imsinu9 imsinu9 commented Apr 12, 2018

Thanks that worked 👍

@agdiaz

This comment has been minimized.

Copy link

@agdiaz agdiaz commented May 28, 2018

Thanks!!!

@moffeemoffee

This comment has been minimized.

Copy link

@moffeemoffee moffeemoffee commented Sep 5, 2018

Thank you!

@karacas

This comment has been minimized.

Copy link

@karacas karacas commented Jan 13, 2019

Nice!

@abhijitmamarde

This comment has been minimized.

Copy link

@abhijitmamarde 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.