看起来是最简单的配置方法了
来源: https://pkief.medium.com/how-to-debug-typescript-with-vs-code-9cec93b4ae56
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Build Project",
"program": "${workspaceFolder}\\src\\app.ts",
"preLaunchTask": "npm: build",
"sourceMaps": true,
"smartStep": true,
"internalConsoleOptions": "openOnSessionStart",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
]
}
]
}
package.json:
{
"name": "vscode-typescript-debugging",
"version": "1.0.0",
"devDependencies": {
"typescript": "^2.7.2"
},
"scripts": {
"start": "node out/app.js",
"prestart": "npm run build",
"build": "tsc"
}
}
发表回复