Sublime Forum

Add single folder in node_modules to index list



This has been vexing me. I have one package in my node_modules which I’d like indexed but exclude all other node_modules. I’m wanting to be able to “go to definition” for things in that package but I don’t want all the other stuff showing up in my “Goto Anything” lists. Possible?



If you use sublime-project files, you can have two path entries in the project:

            "path": ".",
            "folder_exclude_patterns": ["node_modules"],
            "path": "node_modules/abbrev",
            "name": "abbrev",

That will directly elide the overall node_modules folder, but add in the one package as a top level folder, which will be indexed as per normal.

1 Like


Thank you! This is what I needed. To expand for those who also have this issue I was required to make the following changes to make what you gave work.

  • In my overall User settings: "index_exclude_gitignore": false
  • Epand project settings folder_exclude_patterns to include things that are now searchable via above gitignore setting.