I have been following several SO links on how to run both tsc -w and nodemon app.js in a single command.
Link which i followed: How do I execute typescript watch and running server at the same time?
I was working on a project in node.js with typescript. Each time when there is change in ts code, I want to compile using tsc -w and then execute running server with nodemon app.js file. The problem is I tried with both commands, but still it is not running the second command. I have no idea why it is not working.
Commands I used inside package.json scripts
"dev1": "tsc -w && nodemon ./.build/src/app.js"
,
"dev2": "tsc && concurrently \"tsc -w\" \"nodemon ./.build/src/app.js\""
Ran npm run dev1
Ran npm run dev2
Currently only the first command is running and I am not able to see the logs which will come when nodemon runs. Terminal is showing only below log:
Found 0 errors. Watching for file changes
[Note: both commands are running perfectly when i tried to run one after another]
Versions using (bit older)
typescript: 3.0.1
nodemon: 2.0.7
ts-node: 5.0.1
Any help would be really appreciated. I dont want to use any extra package like ts-node-dev.