Well I just wanted to know is there any command which will directly compile the typescript code and get the output. Right now, what i am doing is,every time when i make changes
This is based on solution proposed by @ThomasThiebaud. I had to modify it a little to make sure the files are built in dist/
before nodemon tries to start the server.
"scripts": {
"clean": "rimraf dist",
"build": "tsc",
"watch:build": "tsc --watch",
"watch:server": "nodemon './dist/index.js' --watch './dist'",
"start": "npm-run-all clean build --parallel watch:build watch:server --print-label"
},
You still need to run npm start
to start the whole thing.