How to reload debugger on file change/save
Hi there, i'm using debugger for developing GraphQL Node JS Server (Typescript). Without debugger it restarts after file change by nodemon. How can i get debugger restarted after file change or save?
Here is my config:
Please sign in to leave a comment.
You can still use nodemon for restarting - why not?
How is it? Config above simply says "Run index.ts with Node.js in Typescript mode".What exactly i need to type and in which field?
The recommended way to debug it is using the Attach to a Node.js/Chrome debug configuration with the Reconnect Automatically option enabled, as described in https://www.jetbrains.com/help/webstorm/2018.3/running-and-debugging-node-js.html#node_debugging_overview, Debugging a Node.js application that uses nodemon
- create a nodemon-debug.json with exec set as follows:
- create an npm script in your package.json to run nodemon with this config:
- create Attach to a Node.js/Chrome debug configuration:
- run your npm script, then select configuration above and press Debug:
Yeah, it works! Thank you! Only one little problem:
Now i need run server by nodemon:debug command and then manualy run debugger. If i adding this nodemon:debug in "Before launch" menu it doesnt work, and i suppose because of there is no exit code thrown out of nodemon:debug comand.
yes, exactly - the main process (debugger) is waiting for return code from a task added to 'before launch' to start. This is the way 'before launch' is designed - it's supposed to be used to run some sort of pre-processing before running the main process.