目录下新建 tsconfig.json

{
  "compilerOptions": {
      "module": "commonjs",
      "target": "es5",
      "noImplicitAny": true,
      "outDir": "./dist",
      "sourceMap": true
  },
  "include": [
      "src/**/*"
  ]
}

 

配置 launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Current TS File",
            "type": "node",
            "request": "launch",
            "program": "${workspaceRoot}/node_modules/ts-node/dist/bin.js",
            "args": [
                "${relativeFile}"
            ],
            "cwd": "${workspaceRoot}",
            "protocol": "inspector"
        }
    ]
}

 

 

调试

  

  按F5

    

    

 

 

开始愉快的调试了

 

posted on 2020-07-12 18:00  DMC-尼禄  阅读(4139)  评论(0编辑  收藏  举报