Vite
Overview
Vite (by vitejs) is "next generation frontend tooling" — a build tool with two parts: a dev server that serves source over native ES modules with extremely fast Hot Module Replacement, and a production build command that bundles optimized static assets. It is framework-agnostic (templates for vanilla, React, Vue, Svelte, and more) and is the build layer under many meta-frameworks. Read this when scaffolding a single-page app or configuring builds, plugins, or the dev server.
Official sources
Install / setup
npm create vite@latest
Core concepts
- Native-ESM dev server. In development Vite serves source files as native ES modules, so it does not bundle the whole app up front, enabling fast startup.
- Hot Module Replacement (HMR). Edits update modules in place quickly without a full reload.
- Production build.
vite build produces optimized, bundled static assets (Vite uses Rolldown to bundle for production).
- Framework-agnostic templates. Scaffolding offers templates for vanilla, React, Vue, Svelte, Solid, and others.
- Plugin API + JS API. A typed Plugin API and programmatic JavaScript API let you extend and embed Vite.
- Dependency pre-bundling. Vite pre-bundles dependencies to convert them to ESM and speed up dev page loads.
Best practices
- Scaffold with
npm create vite@latest and pick a template, as the official guide shows.
- Run a supported Node.js version (20.19+ or 22.12+) per the docs; upgrade if a template warns it needs higher.
- Use the
public/ folder for assets served as-is and import other assets so Vite can hash/optimize them.
- Extend behavior through the Plugin API rather than patching the build manually.
Common pitfalls
- Running on an unsupported Node.js version → install Node 20.19+/22.12+ (some templates require higher) as the docs state.
- Expecting the dev server's unbundled behavior to mirror the production bundle exactly → test the output of
vite build / vite preview before deploying.
- Referencing static assets by a guessed path instead of importing them or placing them in
public/ → use imports or public/ so paths resolve after build.
Examples
# Scaffold, then run the dev server
npm create vite@latest my-app
cd my-app
npm install
npm run dev
Further reading
Related skills
- ../sveltekit — meta-framework built on Vite
- ../nextjs — React meta-framework (uses its own bundler, Turbopack)
- ../astro — content framework built on Vite tooling
1---2name: vite3description: Fast frontend build tool and dev server — native-ESM dev with instant HMR, optimized production builds; consult when scaffolding or configuring SPAs.4domain: stack5category: meta6tags: [build-tool, dev-server, esm, hmr, bundler]7official_sources:8 - https://vite.dev/guide/9 - https://github.com/vitejs/vite10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/vite13---1415# Vite1617## Overview18Vite (by vitejs) is "next generation frontend tooling" — a build tool with two parts: a dev server that serves source over native ES modules with extremely fast Hot Module Replacement, and a production build command that bundles optimized static assets. It is framework-agnostic (templates for vanilla, React, Vue, Svelte, and more) and is the build layer under many meta-frameworks. Read this when scaffolding a single-page app or configuring builds, plugins, or the dev server.1920## Official sources21- Docs / guide: https://vite.dev/guide/22- Repo: https://github.com/vitejs/vite23- Install / scaffolding: https://vite.dev/guide/#scaffolding-your-first-vite-project2425## Install / setup26```bash27npm create vite@latest28```2930## Core concepts31- **Native-ESM dev server.** In development Vite serves source files as native ES modules, so it does not bundle the whole app up front, enabling fast startup.32- **Hot Module Replacement (HMR).** Edits update modules in place quickly without a full reload.33- **Production build.** `vite build` produces optimized, bundled static assets (Vite uses Rolldown to bundle for production).34- **Framework-agnostic templates.** Scaffolding offers templates for vanilla, React, Vue, Svelte, Solid, and others.35- **Plugin API + JS API.** A typed Plugin API and programmatic JavaScript API let you extend and embed Vite.36- **Dependency pre-bundling.** Vite pre-bundles dependencies to convert them to ESM and speed up dev page loads.3738## Best practices39- Scaffold with **`npm create vite@latest`** and pick a template, as the official guide shows.40- Run a supported **Node.js version (20.19+ or 22.12+)** per the docs; upgrade if a template warns it needs higher.41- Use the **`public/`** folder for assets served as-is and `import` other assets so Vite can hash/optimize them.42- Extend behavior through the **Plugin API** rather than patching the build manually.4344## Common pitfalls45- Running on an unsupported Node.js version → install Node 20.19+/22.12+ (some templates require higher) as the docs state.46- Expecting the dev server's unbundled behavior to mirror the production bundle exactly → test the output of `vite build` / `vite preview` before deploying.47- Referencing static assets by a guessed path instead of importing them or placing them in `public/` → use imports or `public/` so paths resolve after build.4849## Examples50```bash51# Scaffold, then run the dev server52npm create vite@latest my-app53cd my-app54npm install55npm run dev56```5758## Further reading59- Features: https://vite.dev/guide/features60- Plugin API: https://vite.dev/guide/api-plugin6162## Related skills63- ../sveltekit — meta-framework built on Vite64- ../nextjs — React meta-framework (uses its own bundler, Turbopack)65- ../astro — content framework built on Vite tooling