Chi*_*ani 6 debugging visual-studio-code microsoft-edge angular vscode-debugger
我正在使用Edge 扩展。以下是配置launch.json
:
"configurations": [
{
"name": "ng serve",
"type": "edge",
"request": "launch",
"url": "http://localhost:4200/",
"webRoot": "${workspaceFolder}",
"sourceMaps": true
}]
Run Code Online (Sandbox Code Playgroud)
根据VS Code 中的文档,这里有更详细的步骤:
我尝试清除所有断点,重新启动 vs 代码(和机器),关闭所有浏览器实例,但仍然得到相同的行为。调试器能够在浏览器中启动 angular 应用程序,但无法命中断点。
那么,是否有任何其他配置可以使其与 Edge 浏览器一起使用。当前配置适用于 chrome 浏览器(只需在 launch.json 中用 chrome 替换 edge)。
以下确实到达了断点,但它们在 vscode 中显示为未经验证(空心圆圈)。我认为这可能与内联源映射有关。
{
"version": "0.2.0",
"configurations": [
{
"name": "debug chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:4200/#",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack:/./*": "${webRoot}/*",
"webpack:/src/*": "${webRoot}/src/*",
"webpack:/*": "*",
"webpack:/./~/*": "${webRoot}/node_modules/*"
}
},
{
"name": "debug edge",
"type": "edge",
"request": "launch",
"url": "http://localhost:4200/#",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack:/./*": "${webRoot}/*",
"webpack:/src/*": "${webRoot}/src/*",
"webpack:/*": "*",
"webpack:/./~/*": "${webRoot}/node_modules/*"
},
},
{
"name": "ng test",
"type": "chrome",
"request": "launch",
"url": "http://localhost:9876/debug.html",
"webRoot": "${workspaceFolder}"
},
{
"name": "ng e2e",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/protractor/bin/protractor",
"protocol": "inspector",
"args": ["${workspaceFolder}/protractor.conf.js"]
}
]
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4492 次 |
最近记录: |