fix: refactor watch code for tsconfig changes to use watchChange hook
the refactored code had a change that caused every .json file change to trigger a full reload, this has been corrected.
For now multiple servers can still share one cache instance as the cache only contains information about tsconfig files that do not differ across environments.
Ultimately we want to have a more fine-grained invalidation when a tsconfig changes, but we would have to find out tsconfigs affected by this change (referenced from or extended by, as well as ancestors and then find all modules transpiled with any of these...)
TL;DR this is very complicated
changes to tsconfig.json should be rare enough that a full reload doesn't hurt too much.
Description
Run & review this pull request in StackBlitz Codeflow.
see here for an alternative approach: https://github.com/vitejs/vite/pull/17317
closing as we merged https://github.com/vitejs/vite/pull/17317