Commits
Click on a commit to change the comparison rangefeat: add clear_cache_without_tsconfig for HMR optimization
Add a new method `clear_cache_without_tsconfig()` that clears the path
cache while preserving the tsconfig cache. This is useful for HMR (Hot
Module Replacement) scenarios where tsconfig.json doesn't change during
development.
When using tsconfig path aliases (especially wildcard patterns like
`"*": ["./src/*"]`), HMR can intermittently fail with "Module not found"
errors because:
1. During HMR, rspack calls `clear_cache()` which clears both the path
cache AND tsconfig cache
2. Re-parsing `tsconfig.json` on every HMR update is wasteful
3. Race conditions during re-parsing can cause intermittent module
resolution failures
Related: https://github.com/web-infra-dev/rspack/issues/12753
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>