@ angular / cli 9.1.7 28/05/2020的另一个更新...
现在这是@ angular / cli 9.1.7的工作配置。卸下sourceMapPathOverrides
"sourceMapPathOverrides": {
"*": "${webRoot}/*"
}
{
"version": "0.2.0",
"configurations": [{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:21460",
"webRoot": "${workspaceFolder}"
}]
}
我对“未经验证的断点”问题的解决方案。
环境
- Angular CLI 8.1.1
- Visual Studio代码1.36.1
- Chrome扩展程序4.11.6的调试器
通过“添加配置”选项在VSC中创建的默认.vscode / launch.json看起来与此类似(我将端口从8080更改为4200)。
{
"version": "0.2.0",
"configurations": [{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}"
}]
}
在下面添加项目可以解决“未验证的断点”问题。
"sourceMapPathOverrides": {
"*": "${webRoot}/*"
}
完成并正常运行.vscode / launch.json:
{
"version": "0.2.0",
"configurations": [{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"*": "${webRoot}/*"
}
}]
}
可以添加一些其他项目:
"breakOnLoad": true,
"sourceMaps": true,
但是,我不需要这些来解决问题。
{
"version": "0.2.0",
"configurations": [{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:4200",
"webRoot": "${workspaceFolder}",
"breakOnLoad": true,
"sourceMaps": true,
"sourceMapPathOverrides": {
"*": "${webRoot}/*"
}
}]
}