본문 바로가기
  • Welcome
Tools

[VS Code] VS Code JavaScript 디버깅

by Ben romantic balik 2022. 12. 22.
반응형

비쥬얼스튜디오 코드에서 JavaScript 코드를 디버깅하는 방법에 대해서 알아보자.

 

1. 우선 사이드바에 있는 'Run and Debug'메뉴를 누른다. 없다면 단축키 Ctrl+ Shift + D

2. 아래의 'Run and Debug' 버튼을 클릭한다.

3. VS Code 화면의 중앙위에서 chrome 을 선택한다.

 

이때 .vscode > launch.json 화면이 보인다면 아래와 같이 입력하면 된다. 

url은 각자의 상황에 맞게 입력하면 된다.

{
    // 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}"
        }
    ]
}
   
반응형