美文网首页
vscode 调试 pomelo教程

vscode 调试 pomelo教程

作者: 成少天地 | 来源:发表于2017-12-26 19:50 被阅读0次
    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 附加到远程计划


    image.png

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


    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


    image.png

    切换到调试窗口


    image.png

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

    相关文章

      网友评论

          本文标题:vscode 调试 pomelo教程

          本文链接:https://www.haomeiwen.com/subject/spbsgxtx.html