0

How do I run my HTML in a browser using VS Code? I've tried to find instructions online but I cannot find a solution.

I tried adding this to my tasks.json:

{
"version": "0.1.0",

"command": "explorer",

"windows": {
    "command": "explorer.exe"
},

"args": ["index.html"]
}

But if I ctrl + shift + b it just opens my documents folder instead of the browser. I tried the steps here: How to view my HTML code in browser with Visual Studio Code? but nothing has worked so far.

Community
  • 1
  • 1
Mahmud Adam
  • 3,489
  • 8
  • 33
  • 54

1 Answers1

1

Currently, I use Gulp, NodeMon and BrowserSync with VSC Tasks and Debugger and this works really well on multiple PC's and devices. This can take a bit of setup though. Link to Stack Post

At the time of this writing, recently an extension called Debugger for Chrome was developed by MS. I find this debugger very useful and flexible. One of it's features allows starting a debugging instance in Chrome for the client side app. Without break points it will just load the client side app in the chrome browser. I frequently switch between this client debugger and the native Chrome Dev tools.

Debugger for Chrome

There also an extension I haven't tried called View In Browser.

View In Browser

Community
  • 1
  • 1
GJSmith3rd
  • 806
  • 5
  • 7