What kind of settings can I use in Visual Studio Code to hide certain .js and .map files ?
Asked
Active
Viewed 5,085 times
4

toskv
- 30,680
- 7
- 72
- 74

runtimeZero
- 26,466
- 27
- 73
- 126
-
3Possible duplicate of [Hide .js.map files in Visual Studio Code](http://stackoverflow.com/questions/31587949/hide-js-map-files-in-visual-studio-code) – Structed May 01 '17 at 22:32
3 Answers
18
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"}
}
}

Jess Chadwick
- 2,373
- 2
- 21
- 24
12
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.

toskv
- 30,680
- 7
- 72
- 74
-
3I would still recommend you use tsconfig.json to output the js and sourcemaps to a separate folder, it makes it easier to maintain. – toskv Mar 20 '16 at 21:52
2
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.

Sangram Nandkhile
- 17,634
- 19
- 82
- 116