I'm trying to debug a Node.js application using TypeScript in VSCode. I want :
- To simply hit "F5". I don't want to start
nodemonor something else manually in a terminal. - The TypeScript files to be automatically recompiled when they are changed.
- The application to be automatically restarted when TypeScript files are recompiled.
Here is my best try [project on GitHub].
Using this project :
I hit "F5" and the application starts correctly in debug mode. This is done by calling a
Gulptask which usesnodemonto start the application using--debug-brk=5858.If I add a breakpoint in
app.ts, on the "response.end(...)" line, it works well.But when I change the
app.tsfile, for example by modifying "Date1" for "Date2", the recompilation is done properly but the debugging session ends!!
I'm not sure what I'm missing, since in launch.json I do have an "attach" section with the "restart": true property.
Anybody has a working example of a Node.js application that can be debugged in VSCode with automatic TypeScript files recompilation and automatic application restart?
UPDATE : thanks a lot to Andre. It seems that achieving what I want is currently not possible. Here's an issue created to add the feature required to make it possible.