在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 开始断点调式。