-
在VS里面安装插件Debugger for Chrome
2FC3567A-68B8-49C1-869D-32A5BEC9E060.png -
打开运行
6F4A0F01-0E5F-4D15-AE39-72CF9DDE6E42.png
发现出现访问失败:
56FDEE35-57DC-45BC-976B-E9156787F745.png
- 修改launch.json
原来是这样:
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}"
}
]
}
修改
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",
"url": "http://localhost:7456",
"webRoot": "${workspaceRoot}",
"sourceMapPathOverrides": {
"assets/*": "${workspaceRoot}/assets/*"
},
"sourceMaps": true,
"userDataDir": "${workspaceRoot}/.vscode/chrome",
"diagnosticLogging": false,
"outFiles": [
"${workspaceRoot}/dist/**/*.ts"
]
}
]
}
大功告成
网友评论