如何在 VS Code 上使用打字稿调试 feathersjs?

How to debug feathersjs with typescript on VS Code?

我想使用 VSCode 调试 typescript feathersjs 项目,但是当我启动程序时出现错误

"Cannot launch program '[project_path]/src/index.ts' because corresponding JavaScript cannot be found. "

我的 launch.json 看起来像这样:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${workspaceFolder}/src/index.ts",
            "preLaunchTask": "tsc: build - tsconfig.json",
            "outFiles": [
                "${workspaceFolder}/lib/**/*.js"
            ]
        }
    ]
}

没有生成打字稿 sourceMaps。

要解决此问题,请转到 tsconfig.json 并在 compilerOptions 上添加 '"sourceMap": true'

{
  "compilerOptions":{
    "target": "es2018",
    "module": "commonjs",
    "outDir": "./lib",
    "rootDir": "./src",
    "strict":是的,
    "esModuleInterop": 是的,
    <b>"sourceMap": 真</b>
  },
  "exclude": [
    "test"
  ]
}