Déboguer js dans VS Code
Installez d'abord deux plugins
- débogueur pour chrome
- Le serveur live
crée un fichier index.html, crée un fichier index.js
et introduit le fichier index.js dans index.html
Rupture dans le fichier index.js
Créez le fichier launch.json
Environnement sélectionnez chrome pour
modifier launch.json comme suit
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "chrome 调试",
"url": "http://localhost:5500",
"webRoot": "${workspaceFolder}"
}
]
}
Cliquez pour déboguer