【发布时间】:2021-11-18 09:54:07
【问题描述】:
我最近尝试了 vscode 中的调试工具。一切似乎都运行良好,我已经设置了 launch.json 并设置了我的程序属性。问题是,断点只能在 index.ts 文件中使用,而且我还有一个 commands 文件夹以及一个名为 Champion.ts 的文件,其中断点保持未绑定状态。如何让 vscode 也调试这些文件?
文件结构
myapp/
├─ commands/
│ ├─ champion.ts
├─ index.ts
├─ out/
│ ├─ commands/
│ │ ├─ champion.js
│ ├─ index.js
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/index.ts",
"sourceMaps": true,
"outFiles": [
"${workspaceFolder}/out/*.js"
]
}
]
}
【问题讨论】:
标签: node.js typescript vscode-debugger