rstackjs
rspack-resolver
BlogDocsChangelog

feat: add clear_cache_without_tsconfig for HMR optimization

#152
Comparing
RobHannay:feat/clear-cache-without-tsconfig
(
9b5a74c
) with
main
(
20e7f7c
)
CodSpeed Performance Gauge
0%
Untouched
6

Benchmarks

Passed

resolver[multi-thread]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
+1%
73.1 ms72.6 ms
resolver[pnp resolve]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
0%
2.1 ms2.1 ms
resolver[resolve from symlinks]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
0%
227.7 ms227.1 ms
resolver[single-thread]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
0%
64.2 ms64.2 ms
resolver[[single-threaded]resolve with many extensions]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
0%
171.9 ms172.6 ms
resolver[resolve from symlinks multi thread]
benches/resolver.rs::resolver::bench_resolver
CodSpeed Performance Gauge
-1%
135 ms136 ms

Commits

Click on a commit to change the comparison range
Base
main
20e7f7c
+0.05%
feat: 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>
9b5a74c
5 days ago
by RobHannay
© 2026 CodSpeed Technology
Home Terms Privacy Docs