What kind of settings can I use in Visual Studio Code to hide certain .js and .map files ?
3 Answers
You probably don't want to blindly hide all .js and .map files, only the ones that are generated from an associated .ts file like you show in your screenshot.
To conditionally hide them, you're going to want to do this instead:
{
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/*.js.map": true,
"**/*.js": {"when": "$(basename).ts"}
}
}
1 Comment
You can configure the files.exclude properties in the User Settings.
Add this to your user settings file.
{
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/*.js": true,
"**/*.js.map": true
}
}
You can open the settings file from the command pallet (ctrl + shift + p) and searching for settings.
2 Comments
If you don't find settings.json in .vs code folder, you may generate it through vs code.
File >> Preferences >> Settings >>
Notice the drop-down on the right side.
Click on it and select the workspace settings.
You may paste your json settings.
{
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/*.js.map": true,
"**/*.js": {"when": "$(basename).ts"},
"**/node_modules/": true, <-- To hide node modules files
"**/*.spec.ts": true <-- To hide cli generated files
}
}
Make sure that you save the file.
