lanuch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: 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}",
"file": "${workspaceFolder}/index.html"
}
]
}
这里需要注意的是Debugger for Chrom 默认生成的lanuch.json文件中,只指定了url访问路径, 如果你的项目未发布到本地web服务器当中,则无法通过配置的url路径访问html页面,因此只能通过file属性指定首页文件访问
或者将项目目录放到web服务器目录下,配置正确的url去访问,例如将helloword工程放到apache服务器的htdocs目录下,在launch.json文件中 指定正确的url访问路径 http://localhost:8080/site/helloword/index.html, 即可按快捷键F5进行自动运行调试。