xiaowang0808
使用egg脚手架搭建好最基本的项目后,当我们想调试代码时,该怎么做呢?你还是选择不断得console.log?太low了,那么该怎么debug呢?
本文针对 Node.js 7.x 及之后的版本
1.在根目录创建 .vscode目录,下面创建 launch.json
// .vscode/launch.json
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch Egg",
      "type": "node",
      "request": "launch",
      "cwd": "${workspaceRoot}",
      "runtimeExecutable": "npm",
      "windows": { "runtimeExecutable": "npm.cmd" },
      "runtimeArgs": [ "run", "debug" ],
      "console": "integratedTerminal",
      "protocol": "auto",
      "restart": true,
      "port": 9999
    }
  ]
}

按F5启动即可

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-25
  • 2021-11-04
  • 2022-12-23
  • 2022-01-05
  • 2022-01-01
猜你喜欢
  • 2020-11-04
  • 2021-04-28
  • 2021-12-11
  • 2021-11-21
  • 2022-01-05
  • 2022-12-23
相关资源
相似解决方案