我正在开发一个网络项目。服务器是一个用 TypeScript 编写的 Node.js 应用程序。客户端也是用 Typescript 编写的。 我需要:
我该怎么做?
请参阅我们有关多目标调试的文档: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"]
}
]
}