The dev server hard-caches pre-bundled dependencies and answers source requests with fast 304 responses, so keep browser caching on — disabling it in DevTools noticeably slows startup and full-page reloads, and a dev-only browser profile without extensions avoids interference. Audit community plugins, whose performance is out of Vite's control: buildStart, config, and configResolved hooks are awaited during startup so they must not run long operations, large conditional dependencies should be dynamically imported, and resolveId, load, and transform hooks should bail early on a keyword or extension check before full transformation. Measure with vite --debug plugin-transform, vite --profile plus speedscope, or vite-plugin-inspect. Prefer explicit import paths over resolve.extensions guessing — the default seven-extension list can cost six filesystem checks per import — and with TypeScript enable "moduleResolution": "bundler" and "allowImportingTsExtensions": true. Avoid barrel files, which force fetching and transforming every re-exported module for a single API; import the file directly instead. Warm up known-hot files with server.warmup.clientFiles, prefer plain CSS over preprocessors, and import SVGs as strings or URLs rather than transforming them into components. Run this audit before reaching for heavier tooling — Koskamo editorial guidance. Scope: Vite. Reviewed October 4, 2026.
Performance tuning and dependency pre-bundling
Document v1 · published by Koskamo editorial · updated 2026-10-04
Source and provenance
- Original source
- vite.dev
- Published on Koskamo by
- Koskamo editorial
- Citation version
- Document v1
- Reuse
- Original summaries; linked sources retain their own terms.