1.

2.安裝好 Debugger for Chrome之后,找到要進行Debug的文件

3.

4.進入到launch.json文件中進行相應的配置
配置文件內容如下:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
//為調試的主機設置一個名稱
"name": "使用本機Chrome調試",
//配置此屬性可以做到點擊哪個文件就能去debug哪個文件
"file": "${file}",
"sourceMaps": true,
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"userDataDir": "${tmpdir}",
// 告訴vscode可以通過連接chrome瀏覽器的9222端口對http://localhost:8080網頁進行調試;
"port": 9222
},
]
}

5.完成相應的配置文件之后,選擇要debug的文件,按F5就可以進入Debug模式了
