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
Favna3mo ago
it reloads the JS files
Shrewd 💫
Shrewd 💫OP3mo 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
Favna3mo ago
you run tsc with the --watch flag in the terminal
Favna
Favna3mo ago
but TS has a lot of documentation and guides so you really should just read that
Shrewd 💫
Shrewd 💫OP3mo 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
Favna3mo ago
if you set the incremental option to true yes
Shrewd 💫
Shrewd 💫OP3mo 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