I'm using the VS Code Debugger for Chrome to debug my web app. In the launch.json
where all the configurations are the task is defined like this
{
"name": "Debug App in Chrome",
"type": "chrome",
"request": "launch",
"url": "http://localhost:8080/",
"webRoot": "${workspaceRoot}",
"sourceMaps": true
}
That works fine. Opens the browser on the specific address and the debug tools work fine.
But I want before opening the browser to have a preLaunchTask
that would build my project and create a server so when the browser is open there is an actual server on that address/port. So I added this line "preLaunchTask": "server:dev"
. That task builds the project, starts a watch mode and creates the server. But when I added that task, the prelaunch task is executed successfully but the browser does not open at all.
I'm guessing that is because the --watch
flag, actually keeps the task "alive" (and same maybe for the creation of the server) and the VS Code waits for the preLaunchTask
to terminate completely before starting the main task?
My question is: Is there a way to tell VS Code that the prelaunch task actually does not terminate, so it should not wait for it to end completely before starting the main task? Or I'll not be able to do all this (building, watching, starting server and opening the browser) with only 1 button?