文件位置:文件(File)-首選項(Preference)-設置(setting)
打開setting.json文件輸入一下內容即可
{ "search.exclude": { "**/node_modules": true, "**/bower_components": true, "build/": true, "temp/": true, "library/": true, "**/*.anim": true }, "files.exclude": { "**/node_modules": true, "**/.git": true, "**/.DS_Store": true, "**/*.meta": true, "library/": true, "local/": true, "temp/": true } }
上面的字段將為 VS Code 設置搜索時排除的目錄,和在文件列表中隱藏的文件類型。由於 build, temp, library 都是編輯器運行時自動生成的路徑,而且會包含我們寫入的腳本內容,所以應該在搜索中排除。而 assets 目錄下的每個文件都會生成一個 .meta 文件,一般來說我們不需要關心他的內容,node_modules文件較大, 我一般也隱藏掉, 如果不需要的話, 可以不設置此項