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": 3014, "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": 5858,
            "localRoot": "${workspaceRoot}",
            "remoteRoot": "${workspaceRoot}"
        },
        {
            "type": "node",
            "request": "launch",
            "name": "Debug app.js",
            "program": "${workspaceRoot}/app.js"
        },
    ]
}

 

  

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

posted @ 2018-07-30 17:18  打望  阅读(273)  评论(0编辑  收藏  举报