pomelo vscode 调试配置

时间:2023-03-10 03:26:23
pomelo vscode 调试配置

步骤

  1. config/server.js 配置
  2. .vscode/launch.json 配置

详细

1. 在server的配置中添加 args 参数,此参数为node开启此服务器时命令参数

"gate": [
{"id": "gate-server-1", "host": "127.0.0.1", "clientPort": , "frontend": true, "args": " --inspect=5858"}
]

使用--inspect 还是 --debug 似乎与node版本有关,暂不知两者关系,留待后续研究。。。

2. 在vscode中添加调试配置,添加一个远程调试,port为--inspect对应的端口(.vscode/launch.json)

{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Debug remote",
"address": "127.0.0.1",
"port": ,
"localRoot": "${workspaceRoot}",
"remoteRoot": "${workspaceRoot}"
},
{
"type": "node",
"request": "launch",
"name": "Debug app.js",
"program": "${workspaceRoot}/app.js"
},
]
}

  

现在pomelo 就可以断点调试了!!!