vscode-live-server-plus-plus icon indicating copy to clipboard operation
vscode-live-server-plus-plus copied to clipboard

What launch.json configuration is needed to open in Live Server?

Open AlGantori opened this issue 2 years ago • 1 comments

I would like to be able to open VSCode and press F5 to launch the currently viewed .html file into the live server without having to know it's Alt-L Alt-O key combination.

I tried the Run / Add Configuration however what got added into launch.json is not "run in live server" Any insights on how to achieve press F5 to run would be much appreciated. Thank you.

image

{
    // 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": "pwa-chrome",
            "request": "launch",
            "name": "Open index.html",
            "file": "s:\\_W\\ARP\\UPS.Help\\SRC\\UPS.Help\\Info\\index.html"
        }
    ]
}

AlGantori avatar May 21 '22 02:05 AlGantori

Thru some guess work I got the following to partially work, I say partially because:

  1. It does open the current viewed file into the live server
  2. When switching to another .html file and pressing F5 it does NOT launch them until the first is closed.

image

Reference for the variables available in launch.json here https://code.visualstudio.com/docs/editor/variables-reference

AlGantori avatar May 21 '22 02:05 AlGantori