Closed dreamfalcon closed 1 year ago
Managed to find a way.
1 - Run tsc with npx tsc --watch
2 - Enable "sourceMap": true
on tsconfig.
3 - Add reloadHandler to debug command.
"scripts": {
"debug": "SET SLS_DEBUG=* && node --inspect node_modules\\serverless\\bin\\serverless offline --reloadHandler"
},
4 - Put the environment variables on the launch.json.
{
"cwd": "${workspaceFolder}",
"name": "Debug Serverless Offline",
"request": "launch",
"runtimeArgs": ["run", "debug"],
"runtimeExecutable": "npm",
"sourceMaps": true,
"type": "node",
"env": {
"ENVIRONMENT": "dev",
}
}
Now I'm able to use breakpoints, watch the variables and hot reload works.
Hi,
I'm trying to follow the documentation in how to set up the debug on Vs code. But the breakpoints and hot reloading are not working.
Until now I have this:
package.json
launch.json:
Any idea whats wrong?