Hi everyone,
I’m learning Node.js with TypeScript and I’m trying to improve my development workflow. Right now, I compile my TypeScript files and then manually restart the server whenever I make changes. I was wondering if there’s a way to use npm scripts to run both the TypeScript compiler in watch mode and nodemon at the same time.
My current package.json scripts look like this:
{
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "tsc --watch"
}
}
I’d like to automatically recompile my TypeScript files and have nodemon restart the server whenever the compiled JavaScript changes. Is there a recommended way to do this using npm scripts, or should I use another tool like concurrently or npm-run-all?
I’m still learning, so I’d appreciate a beginner-friendly explanation. Thanks!
