Avatar ·

How to set up automatic reload of ts-node when TypeScript files change

Hello everyone! I'm a beginner TypeScript developer and I've encountered a problem while developing a server application on Node.js.\n\nI have a TypeScript project that I run using `ts-node`. Here's what my `package.json` file looks like:\n\n```json\n{\n "scripts": {\n "start": "ts-node src/index.ts"\n }\n}\n```\n\nEvery time I make changes to `.ts` files, I have to manually stop the process (Ctrl+C) and run it again. This is very inconvenient and slows down development.\n\nI've heard about `nodemon`, but I don't understand how to properly configure it to work with TypeScript. I tried installing `nodemon` and running it like this:\n\n```bash\nnodemon --exec ts-node src/index.ts\n```\n\nBut after changing a file, nodemon restarts the process, but the changes are not applied, or strange errors appear.