I'm trying to get a simple react frontend and nodejs backend up and running and debuggable in vs code. I'm using a compound launch configuration to launch 'client' and 'server' together. The nodejs backend is started automatically for me, but I always have to do an npm start in the console for the client for it to connect. All the tutorials I've seen suggest that this step has to happen before running the debug configuration in vs code. Is it not possible for vs code to start the frontend just like it does for the nodejs backend.
This is what my launch.json looks like:
{
// 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",
"compounds": [
{
"name": "Client+Server",
"configurations": [ "Server", "Client" ]
}
],
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Server",
"program": "${workspaceFolder}/server/server.js"
},
{
"type": "chrome",
"request": "launch",
"name": "Client",
"url": "http://localhost:3000",
"webRoot": "${workspaceFolder}/client/src/index.js"
}
]
}