vscode 中 调试egg项目


使用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启动即可


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM