vscode 调试 pomelo教程

  1. launch.json 文件配置如下
    {
    version": "0.2.0",
    "configurations": [
    {
    "type": "node",
    "request": "attach",
    "name": "Attach to Remote",
    "address": "127.0.0.1",
    "port": 32312,
    "localRoot": "${workspaceRoot}",
    "remoteRoot": "${workspaceRoot}"
    },
    {
    "type": "node",
    "request": "launch",
    "name": "Launch Program",
    "program": "${workspaceRoot}/app.js"
    }
    ]
    }

"Attach to Remote" 添加设置nodejs 附加到远程计划


vscode 调试 pomelo教程_第1张图片
image.png

"Launch Program", 添加设置 nodejs 启动计划


vscode 调试 pomelo教程_第2张图片
image.png
  1. servers/config/servers.json 文件配置
    {
    "development":{
    "connector": [
    {"id": "connector-server-1",
    "host": "127.0.0.1",
    "port": 3150,
    "clientHost": "127.0.0.1",
    "clientPort": 3010,
    "args": "--debug=32312",
    "frontend": true}
    ]
    },

"production":{
"connector": [
{"id": "connector-server-1",
"host": "127.0.0.1",
"port": 3150,
"clientHost": "127.0.0.1",
"clientPort": 3010,
"args": "--debug=32312",
"frontend": true}
]
}
}
注意 --debug=32312 端口号 32312 和 launch.json的端口号一致。

vscode添加pomelo helloworld项目gameserver


vscode 调试 pomelo教程_第3张图片
image.png

切换到调试窗口


vscode 调试 pomelo教程_第4张图片
image.png

第一步 启动 Launch Program 第二步 启动Attach to Remote

你可能感兴趣的:(vscode 调试 pomelo教程)