I'm looking for a way to use npm scripts to run tsc --watch && nodemon --watch
at the same time. I can run this commands independently, but when I want run both of them, only the first one is executed.
eg.
if I have this script:
"scripts": {
"runDeb": "set NODE_ENV=development&& tsc --watch && nodemon --watch"
}
tsc --watch
is executed but nodemon
is never called, and vice versa.
I have been using AlterX's solution for a while now and it has worked perfectly, but I have found it to be rather slow. Instead, I am now using tsc-watch. It makes tsc use incremental compilation similar to the
-w
flag, making the restart of the application much faster.It's as easy as putting something similar to this in your package.json: