Commit 2a03a3d
committed
fix: invalidate Vite module graph on template/style HMR updates
Two fixes for HMR reliability:
1. After sending the angular:component-update WS event, call
server.moduleGraph.invalidateModule() so that Vite's transform cache
is cleared and full page reloads serve fresh content.
2. In handleHotUpdate, skip the full-reload for component .ts files that
have a pending HMR update (pendingHmrUpdates). Template/style changes
trigger handleHotUpdate for the owning .ts file via Vite's module
graph dependency tracking, but the .ts file wasn't actually edited.
Without this check, the full-reload overrides the HMR update.1 parent 44d2074 commit 2a03a3d
4 files changed
+15
-0
lines changedBinary file not shown.
Binary file not shown.
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
373 | 380 | | |
374 | 381 | | |
375 | 382 | | |
| |||
654 | 661 | | |
655 | 662 | | |
656 | 663 | | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
657 | 672 | | |
658 | 673 | | |
659 | 674 | | |
| |||
0 commit comments