Trusha_Patel
Trusha_Patel

Reputation: 71

How Launch Multiple HTML files in Visual Studio Code?

I am trying to launch HTML multiple files in the same folder, and open them in Chrome (not a new window with every file) in Visual Studio Code. I tried this solution: Multiple Launch Files in Visual Studio Code, but I think, I am missing something.

I always get the message to close my current debug session before starting a new one.

Here is my launch.json file for the folder:

{
    // 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": [

        {
            "name": "Chrome1",
            "request": "launch",
            "type": "pwa-chrome",
            "webRoot": "${workspaceFolder}",
            "file":"${file}"
        },
        {
            "name": "Chrome2",
            "request": "launch",
            "type": "pwa-chrome",
            "webRoot": "${workspaceFolder}",
            "file": "${file}"
        },
        {
            "name": "Chrome3",
            "request": "launch",
            "type": "pwa-chrome",
            "webRoot": "${workspaceFolder}",
            "file": "${file}"
        }
    ],
        "compounds": [
            {
              "name": "Chrome1/Chrome2/Chrome3",
              "configurations": ["Launch Chrome","Launch Chrome","Launch Chrome"],
              "preLaunchTask": "${defaultBuildTask}"
            }
        ]
}

Thanks!

Upvotes: 1

Views: 1606

Answers (1)

Samuel Mazahery
Samuel Mazahery

Reputation: 352

it does open chrome with 3 tab for 3 debug.

{
    // 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": "Chrome1",
            "file": "${workspaceFolder}/a.html"
        }, {
            "type": "chrome",
            "request": "launch",
            "name": "Chrome2",
            "file": "${workspaceFolder}/b.html"
        }, {
            "type": "chrome",
            "request": "launch",
            "name": "Chrome3",
            "file": "${workspaceFolder}/c.html"
        }
    ],
    "compounds": [{
        "name": "Chrome123",
        "configurations": ["Chrome1", "Chrome2", "Chrome3"],
    }]
}

Upvotes: 3

Related Questions