我开发了web项目。 Server是用TypeScript编写的node.js应用程序。客户端也写在Typescript中。我需要两个能力:
我该怎么做?
答案 0 :(得分:10)
请参阅我们关于多目标调试的文档:https://code.visualstudio.com/Docs/editor/debugging#_multitarget-debugging
在launch.json
中,只需创建一个包含您要调试的目标的compounds
部分
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Server",
"program": "${workspaceRoot}/server.js",
"cwd": "${workspaceRoot}"
},
{
"type": "node",
"request": "launch",
"name": "Client",
"program": "${workspaceRoot}/client.js",
"cwd": "${workspaceRoot}"
}
],
"compounds": [
{
"name": "Server/Client",
"configurations": ["Server", "Client"]
}
]
}