在vscode中使用斷點技術
第一步:安裝插件 Debugger for Chrome Extension
第二步:然后需要配置 VSCode 來連接到 Chrome
第三步:第二步過后會生成一個 launch.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",
// "skipFiles": [
// "<node_internals>/**"
// ],
// "program": "${file}",
"url": "http://localhost:3000",
"webRoot": "${workspaceRoot}"
}
]
}
第四步:按F5 開始斷點調式。