What's the simplest way to debug a static website in vscode?

691 views Asked by At

If I have an html, a css, and a js file, what's the most simple way to debug this in vscode?

According to the documentation you just open the html file, press F5 and vscode will generate a suitable launch.json file. However that doesn't work. For this simplest of all possible scenarios the launch.json that vscode creates is this

"configurations": [
   {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:8080",
      "webRoot": "${workspaceFolder}"
   }
]

...and that's never going to work since vscode doesn't do anything to cause the html file to be served from localhost:8080

Is there not some way to debug this without having to manually install the page in a webserver or running a webserver for the project under nodejs?

0

There are 0 answers