Highlights
- On-demand tsconfig discovery via
projectDiscovery: "lazy", while eager discovery remains the default. - tsconfig/jsconfig files are watched and reloaded automatically in both modes, including during
vite build --watch. - New
logFileoption for per-import resolution traces (passtrueforvite-tsconfig-paths.logor provide a path). - Support for root
/*aliases and other absolute-style imports. - Support for
.astrofiles whenallowJs/looseis enabled.
Fixes
- More reliable tsconfig watching and resolver refreshes: handles lazy discovery edge cases, recreates resolvers after file changes, tolerates missing directories, and copes better with virtual importers.
- Windows path handling now normalizes drive-letter casing to avoid missed matches (#183).
Upgrade notes
- Install the stable release:
pnpm add -D vite-tsconfig-paths. - Opt into lazy discovery or logging when needed:
import tsconfigPaths from 'vite-tsconfig-paths'
export default {
plugins: [
tsconfigPaths({
projectDiscovery: 'lazy',
logFile: true,
}),
],
}- Rooted path patterns such as
"/*": ["src/*"]now resolve the same way tsserver does.