当前位置:   article > 正文

VSCode学习:Debug Angular in Chrome_launch chrome against localhost

launch chrome against localhost
  • Debug Angular in Chrome

  • 在VSCode里安装Debugger for Chrome: 按 Extensions 按钮(下图高亮部分),找到 Debugger for Chrome,安装
  • Launch Chrome against localhost

  1. Launch Chrome against localhost,在 launch.json里添加如下配置,注意 "trace": true 可以帮助生成log文件。

  1. {
  2. "type": "chrome",
  3. "request": "launch",
  4. "name": "Launch Chrome against localhost",
  5. "url": "http://localhost:4200",
  6. "webRoot": "${workspaceFolder}",
  7. "trace": true
  8. }
  • Attach Chrome against localhost

  1. 需要先以debug模式启动Chrome:"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222
  2. 在launch.json里添加如下配置:
  1. {
  2. "type": "chrome",
  3. "request": "attach",
  4. "name": "Attach Chrome against localhost",
  5. "port": 9222,
  6. "webRoot": "${workspaceFolder}",
  7. "trace": true
  8. }

  3. debug 时选择 对应attach的配置:如下

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/菜鸟追梦旅行/article/detail/91159
推荐阅读
相关标签
  

闽ICP备14008679号