VScode next-click debugging typescript code

Debug TS code directly without compiling typescript files

Configuration of launch.json

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

Among them, program is the installation location of ts-node, and args is the entry file path of the program

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324817611&siteId=291194637