Using HMR in TS

So I am considering writing a bot in TS, but my question is, since sapphire supports it, how would I go over using it, like, in TS you have to transpile files to js but what after you make updates to the .ts files, will HMR detect it and reload or how does it look?
Solution:
you run tsc with the --watch flag in the terminal
Jump to solution
7 Replies
Favna
Favna2mo ago
it reloads the JS files
Shrewd 💫
Shrewd 💫OP2mo ago
might be dumb of me to ask but can you explain the process while it comes to ts, i plan on learning it but i wanna get a grasp of how I can make it work with hmr in js I could just do ctrl + s and boom, its reloaded and in ts its apparently so complicated
Solution
Favna
Favna2mo ago
you run tsc with the --watch flag in the terminal
Favna
Favna2mo ago
but TS has a lot of documentation and guides so you really should just read that
Shrewd 💫
Shrewd 💫OP2mo ago
and it will just transpile the files that were edited? so like: if files were previously transpiled but you updated one file and ran tsc, it will only update that one and hmr will detect it? (apologies if im incomprehensible)
Favna
Favna2mo ago
if you set the incremental option to true yes
Shrewd 💫
Shrewd 💫OP2mo ago
alright thank you very much ill find some resources right now and get to them tomorrow 🙏
Want results from more Discord servers?
Add your server