vite icon indicating copy to clipboard operation
vite copied to clipboard

fix: refactor watch code for tsconfig changes to use watchChange hook

Open dominikg opened this issue 1 year ago • 2 comments

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

dominikg avatar May 24 '24 16:05 dominikg

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

see here for an alternative approach: https://github.com/vitejs/vite/pull/17317

dominikg avatar May 25 '24 21:05 dominikg

closing as we merged https://github.com/vitejs/vite/pull/17317

patak-dev avatar Feb 07 '25 15:02 patak-dev