Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude folder from "Explore" tab?

I'm trying to exclude several folders on the Explore tab in Visual Studio Code. To do that, I have added a following jsconfig.json to the root of my project:

{     "compilerOptions": {         "target": "ES6"     },     "exclude": [         "node_modules"     ] } 

But the node_modules folder is still visible in the directory tree.

What am I doing wrong? Are there any other options?

like image 621
Andrey Avatar asked Oct 21 '15 11:10

Andrey


1 Answers

Use files.exclude:

  • Go to File -> Preferences -> Settings (or on Mac Code -> Preferences -> Settings)
  • Pick the workspace settings tab
  • Add this code to the settings.json file displayed on the right side:
    // Place your settings in this file to overwrite default and user settings.      {         "settings": {             "files.exclude": {                 "**/.git": true,         // this is a default value                 "**/.DS_Store": true,    // this is a default value                      "**/node_modules": true, // this excludes all folders                                          // named "node_modules" from                                          // the explore tree                      // alternative version                 "node_modules": true    // this excludes the folder                                          // only from the root of                                         // your workspace              }         }     } 

If you chose File -> Preferences -> User Settings then you configure the exclude folders globally for your current user.

like image 184
Wosi Avatar answered Nov 03 '22 00:11

Wosi