# Vite — card for AI agents

Fast native-ESM powered web development build tool and dev server.

Category: Build tools and bundlers · npm package `vite` · latest version 8.3.5 (checked 2026-11-01)
Install: `npm install vite`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## Vite
- Scaffold with `npm create vite@latest my-app -- --template `. With npm 7+, the extra `--` is needed. Add `--no-interactive` to skip the prompts.
- Use the standard scripts: `vite` for dev, `vite build` for production, and `vite preview` to check the build locally.
- Keep `vite.config.js` in the project root. If you change the root with `vite serve some/sub/dir`, move the config file there too.
- Write explicit import paths such as `import './Component.jsx'`. With TypeScript, set `"moduleResolution": "bundler"` and `"allowImportingTsExtensions": true`.
- Avoid barrel files. Import directly instead, for example `import { slash } from './utils/slash.js'`.
- Only add files to `server.warmup` if they are frequently used. Keep the `buildStart`, `config` and `configResolved` plugin hooks short.
- For older browsers, lower the build target or add `@vitejs/plugin-legacy`. To replace the Vite version used by dependencies, use npm or pnpm overrides.

## Agent Skills for it
- vite from debpalash/VoiceStudio: `npx skills add debpalash/VoiceStudio --skill vite`
- vite from midudev/autoskills: `npx skills add midudev/autoskills --skill vite`
- vite from antfu/skills: `npx skills add antfu/skills --skill vite`

## Docs written for agents
- [llms.txt (index of the docs)](http://vite.dev/llms.txt)

## What it is
- Vite is a frontend build tool with two parts. The first is a dev server that adds features on top of native ES modules, such as Hot Module Replacement (HMR). The second is a build command that bundles your code with Rolldown into static assets for production.
- The design starts from a split. Dependencies, which rarely change, are pre-bundled once. Your application code is served on demand, and Vite transforms each file when the browser requests it. In a Vite project, `index.html` is the entry point and part of the module graph. It is not a file inside `public`.
- The Getting Started guide says Vite is opinionated and ships with defaults, and that framework support comes through plugins. The Why Vite page names frameworks that build on it, including Nuxt, SvelteKit, Astro and React Router. It also names Laravel and Ruby on Rails as backends that use it for frontend assets.

## Caveats
- Dev mode assumes a modern browser: Vite sets `esnext` as the dev transform target and does no syntax lowering. Production builds target Baseline Widely Available browsers, which for this major means browser versions released around mid-2023. Older browsers need a lowered target or `@vitejs/plugin-legacy`.
- Node.js version floor: The docs require Node.js 20.19+ or 22.12+. Some templates need a newer version than that.
- Unbundled dev can slow very large apps: The maintainers write that exceptionally large codebases can see slow page loads because of the number of unbundled requests. A full bundle mode for the dev server is described as something the team is exploring.
- Community plugins can drag performance down: The performance guide says Vite's own plugins are tuned to do little work, but third-party plugins are outside Vite's control. Long work in `buildStart`, `config` or `configResolved` delays dev server startup.
- Barrel files cost page-load time: If you import one API from a barrel file, the dev server fetches and transforms every file that barrel re-exports. The docs advise importing directly from the source file.

## Numbers (AgentGid data)
- Gid Score: 92.0 (#7 of all tools, 1 of 185 in its category)
- Used in 1,238 public projects set up for AI coding agents (19.8%)
- Downloads last week: 287,894,425 (as of 2026-11-24), +41.0% over 4 weeks
- GitHub stars: 84,062 (as of 2026-11-24)
- Last push: 2026-11-24

## Often used with
Tailwind CSS 72.4%, Vitest 53.5%, React 66.7%, TypeScript 83.5%, jsdom 34.1%, Testing Library 34.1%

## Checked alternatives (same job)
- SWC: https://agentgid.com/tools/swc-core/agent.md
- webpack: https://agentgid.com/tools/webpack/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/vite/
- Homepage: https://vite.dev
- Repository: https://github.com/vitejs/vite
- Source: https://github.com/vitejs/vite#readme
- Source: https://github.com/vitejs/vite
- Source: https://github.com/vitejs/vite/releases
- Source: http://vite.dev
- Source: http://vite.dev/guide.md
- Source: http://vite.dev/guide/why.md
- Source: http://vite.dev/guide/performance.md


## Vite: run and build web apps while you code

Vite is a free tool that runs your web app on your own computer while you build it, and packs it into fast files when you publish. Each time you save, the change shows in the browser at once. It comes with starter templates for React, Vue, Svelte and others.

### Where to use it
- Start a new app from a template: Your assistant creates a ready React, Vue, Svelte or plain TypeScript project in one command and starts it.
- See changes the moment you save: While you or your assistant edit a page, the open browser tab updates on save, without a full reload in most cases.
- Publish as plain files: One command makes a dist folder of small files you can upload to any static host, and a second one lets you check them first.
- Settings that may reach the browser: Public settings like a site name go into .env with a VITE_ prefix; anything without the prefix stays out of the browser.
- A site that lives in a sub-folder: When the app runs at example.com/shop/ instead of the main address, all links to scripts, styles and pictures are fixed for that folder.
- Modern front-end for a Laravel or Rails site: Keep pages made by your existing server and let Vite handle the scripts and styles, with instant updates while you work.

### How to start
- Create a project from a template and follow the prompts.

```
npm create vite@latest
```

- Or add Vite to an existing folder that has an index.html and run it.

```
npm install -D vite
npx vite
```

- Build the files for publishing.

```
npx vite build
```


### License
Free to use, also for paid and closed-source products, under the MIT license. The files it builds from your code are yours.

### Good to know
- It needs Node.js 20.19 or newer, or 22.12 or newer, on the computer that runs it.
- By default the published files target browsers from around mid-2023; an official add-on makes extra files for older browsers.
- It does not check TypeScript types; it only turns them into plain JavaScript. Your editor or a separate check has to catch type mistakes.
- Only the newest minor version gets regular fixes; a few earlier ones get security fixes. Version 8.3.7 came out on 9 November 2026.

Checked 2026-11-10 against: https://vite.dev/, https://vite.dev/guide/, https://vite.dev/guide/features, https://vite.dev/guide/build, https://vite.dev/guide/static-deploy, https://vite.dev/guide/env-and-mode, https://vite.dev/guide/migration, https://vite.dev/guide/backend-integration, https://vite.dev/releases, https://github.com/vitejs/vite/blob/main/LICENSE, https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md, https://registry.npmjs.org/vite/8.3.7

### Mistakes to avoid
- Don't: VITE_STRIPE_SECRET_KEY=... in .env, read in front-end code → Do: Keep secrets in variables without the VITE_ prefix and use them only in server or serverless code (Every VITE_ value is copied into the public JavaScript files at build time.)
- Don't: Running vite preview on the server as the live site → Do: Upload dist/ to a static host, or serve it with a real web server (vite preview is only for checking the build on your own machine.)
- Don't: Treating a successful vite build as proof the TypeScript has no errors → Do: Run tsc --noEmit before vite build, or add vite-plugin-checker to see type errors during development (Vite strips types file by file and never checks them.)
- Don't: New esbuild or optimizeDeps.esbuildOptions settings in a Vite 8 config → Do: Use the oxc and optimizeDeps.rolldownOptions settings (In Vite 8 the esbuild options are only converted for backward compatibility and are deprecated.)
- Don't: Editing .env while npm run dev is running and expecting the new value → Do: Stop and restart the dev server after changing .env files (Vite reads .env files once, at start.)

### Questions
- Can I use it for a paid product? Yes. Vite is MIT-licensed.
- Can I put my secret keys in .env? Yes, but never with the VITE_ prefix. VITE_ values are written into the public files; keep secrets on a server.
- Is vite preview a production server? No. It only lets you look at the built files on your own computer. Upload dist/ to a host instead.
- What changed in Vite 8? It now uses Rolldown and Oxc instead of esbuild and Rollup. Old esbuild settings still work for now but are deprecated.
- I changed .env and nothing happened. Why? Vite reads .env files only when it starts. Restart the dev server.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
