eggjs 断点调试
第一步 编辑launch.json
- 点击左边竖排的第四个(中间有蜘蛛的那个图标)
- 点击左边文件launch上调试的下来添加配置,会自动生成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
}
]
}
- 点击调试上的三角形
编辑器中中间会出现 一个浮动的调试栏,(总共6个按钮)
- 选择 controller的home.js
在中间的任意一行右键添加断点列,然后在访问web这个controller时就可以达到断点的效果了