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?
7 Replies
it reloads the JS files
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
you run
tsc
with the --watch
flag in the terminalbut TS has a lot of documentation and guides so you really should just read that
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)
if you set the incremental option to true yes
alright thank you very much
ill find some resources right now and get to them tomorrow 🙏