次世代 Hugo

智能を研ぎ、創造を編む

排除專案目錄與檔案

Sam Xiao's Avatar 2026-05-16

專案中一些 目錄檔案 可能是框架或工具在使用,平常並不會在 VS Code 內編輯,可加以排除不顯示在 Explorer。

Version

VS Code 1.120

Workspace Setting

settings.json

"files.exclude": {
  "node_modules": true,
  "public": true,
  "resources": true,
  ".idea": true,
  ".vscode": false,
  ".git": true,
  ".gitignore": true,
  ".DS_Store": true,
  ".hugo_build.lock": true,
  ".editorconfig": true,
  "package.json": true,
  "package-lock.json": true,
}
  • file.exclude:設定在 Explorer 不顯示的目錄與檔案:
    • node_modules:NPM 套件存放目錄
    • public:Hugo 編譯過的 HTML/CSS/JavaScript
    • resourceshugo server 時所建立的暫存目錄
    • .idea:WebStorm 設定檔目錄
    • .vscode:VS Code 設定檔目錄
    • .git:Git 版本控制目錄
    • .gitignore:Git 忽略規則檔
    • .DS_Store:macOS 資源檔
    • .hugo_build.lockhugo build 所建立 lock 檔
    • .editorconfig:Editor 格式統一設定檔
    • package.json:NPM 設定檔
    • package-lock.json:NPM 依賴版本鎖定檔

Conclusion

  • 本文以 Hugo 專案為範例,可依自己的專案自行設定