首页 > 解决方案 > 如何跳过放置在工作区文件夹上方目录中的多根 vscode 中的文件?

问题描述

我有一个多根工作区,并且有一个根的启动配置。我已skipFiles启用忽略所有.ts文件,但构建步骤看起来是将文件放置在项目的根目录中,而不是任何一个根目录中。因此,如何引用工作区根目录以便跳过这些文件?我不能跳过的文件之一是这个(磁盘上不存在): myproject/src/types/observableobject.ts 我所有的实际文件都存在于:

myproject/
  myproject-frontend/
    src/
  myproject-backend/
    src/
# myproject.code-workspace
{
    "folders": [
        {
            "path": "myproject-backend"
        },
        {
            "path": "myproject-frontend"
        }
    ],
    "settings": {
        "prettier.tabWidth": 4,
        "prettier.packageManager": "yarn"
    }
}
# myproject/myproject-frontend/.vscode/launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Chrome",
      "type": "chrome",
      "request": "launch",
      "url": "http://localhost:3000",
      "smartStep": true,
      "webRoot": "${workspaceFolder}/src",
      "sourceMapPathOverrides": {
        "webpack:///src/*": "${webRoot}/*"
      },
      "skipFiles": [
        "<node_internals>/**/*.js",
        "${workspaceFolder}/**/node_modules/*",
        "${workspaceFolder}/**/*.ts"
      ]
    }
  ]
}

标签: visual-studio-codevscode-settingsvscode-debugger

解决方案


我通过只做一个与磁盘根相关的全局模式而不是workspaceFolder

“/**/*.ts”

推荐阅读