I was able to get this running using preLaunchTask. Now both the debugger and the live server start with one click. Here are my .vscode folder config files.
launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"port": 9222,
"request": "launch",
"type": "pwa-chrome",
"url": "http://localhost:5500",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "StartServer",
"postDebugTask": "StopServer"
}
]
}
tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "StartServer",
"type": "process",
"command": "${input:startServer}"
},
{
"label": "StopServer",
"type": "process",
"command": "${input:stopServer}"
}
],
"inputs": [
{
"id": "startServer",
"type": "command",
"command": "extension.liveServer.goOnline"
},
{
"id": "stopServer",
"type": "command",
"command": "extension.liveServer.goOffline"
}
]
}
settings.json (workspace settings)
{
"liveServer.settings.ChromeDebuggingAttachment": true,
"liveServer.settings.CustomBrowser": "chrome",
"liveServer.settings.host": "localhost",
"liveServer.settings.NoBrowser": true
}