no there is no need to add tsc in start script ts-node-dev do all the jobs but in production we should use our transpiled file as we have already type checked everything
No, actually It does not transpile it automatically I will recommend you to create different scripts for development and production "start:dev": "ts-node-dev src/app.ts",
"start": "tsc && node dist/app.js"
Here are a couple of nooby questions:
should
ts-node-dev
watch the app.ts or the start command should look like this:"start": "npx tsc && ts-node-dev dist/src/app.js
?Meaning, should we be watching the ts file or the compiled version?
If you deploy this app on production, how would you start the server?
no there is no need to add tsc in start script ts-node-dev do all the jobs but in production we should use our transpiled file as we have already type checked everything
ts-node-dev
doesn't transpile, does it? At least in my case, if I want to have the dist/build folder, I do need to manually runtsc
No, actually It does not transpile it automatically I will recommend you to create different scripts for development and production
"start:dev": "ts-node-dev src/app.ts",
"start": "tsc && node dist/app.js"
Thank you!