Can someone provide an example of VS Code configuration that would allow me to:
- Start Node.js debugger
- Edit any TS file, see the project recompiled and debugger restarted?
Is this supported out of the box? Can nodemon
be used somehow? Thanks.
Can someone provide an example of VS Code configuration that would allow me to:
Is this supported out of the box? Can nodemon
be used somehow? Thanks.
Yes, you can use nodemon. In your launch.json, if you trigger intellisense (ctrl+space), you will see snippets with suggested launch configs. There's one for nodemon which looks like this:
{
"type": "node",
"request": "launch",
"name": "nodemon",
"runtimeExecutable": "nodemon",
"runtimeArgs": [
"--debug=5858"
],
"program": "${workspaceRoot}/app.js",
"restart": true,
"port": 5858,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
The docs have an explanation of how it works: https://code.visualstudio.com/docs/editor/node-debugging#_restaring-debug-sessions-automatically-when-source-is-edited