vite-best-practices
Installation
SKILL.md
Vite Best Practices
This edition was verified against stable vite@8.2.2 (August 2026). Vite 8 uses Rolldown for dependency optimization and production builds, Oxc for JavaScript transforms and minification, and Lightning CSS for CSS minification.
For version-sensitive work, confirm the project's installed Vite version first. If the user requests the latest version, also confirm the current latest npm dist-tag and use the matching official documentation; do not apply Vite 8-only options to older projects unless the task includes migration.
Workflow
- Inspect
package.json, the lockfile,vite.config.*, framework plugins, and the scripts that actually invoke Vite. Frameworks may own or wrap Vite configuration. - Separate the requested fix from an upgrade. Preserve the installed major/minor unless the user asks to migrate or the requested API requires it.
- Prefer a Vite-level option over low-level Rolldown/Oxc customization. Preserve existing JavaScript vs TypeScript and ESM conventions instead of rewriting the config format without need.
- Treat release-candidate and experimental APIs as opt-in. State their status and compatibility limits, pin the Vite minor when relying on them, and add them only when the use case justifies the risk.
- Verify with the repository's own checks. At minimum, run the relevant typecheck or config load plus a production build; exercise dev/HMR or SSR behavior when the change affects those paths.
Vite 8 Configuration Names
Use current names in new or migrated Vite 8 configuration. Compatibility aliases still work but are deprecated: