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?
Use files.exclude:
workspace settings
tabAdd 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.