Skip to content
Skillpedia
Websites & UI (frontend)6.0k · #14445

vite

What it does

This skill explains how to set up and configure Vite, the build tool that runs and packages modern web projects. It is for developers who need a fast dev server or a production build.

When to use it

  • ✓When you are setting up or changing the vite.config file in a web project.
  • ✓When you want to write or use a Vite plugin.
  • ✓When you want to build a library or a server-rendered app with Vite.

Skill link

https://github.com/antfu/skills/blob/main/skills/vite/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/antfu/skills/blob/main/skills/vite/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Update my Vite config so the project builds as a library and keeps the TypeScript setup.”

5 new skills a week. 1 minute to read.

How it works

The agent reads the project's Vite config and follows Vite's guidance on settings, plugins and builds, including the newer Rolldown bundler.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Vite

Based on Vite v8.3.1 (Rolldown-powered), generated at 2026-09-25. Vite 8 uses the Rolldown bundler and the Oxc transformer instead of esbuild + Rollup.

Vite is a next-generation frontend build tool with fast dev server (native ESM + HMR) and optimized production builds.

Preferences

  • Use TypeScript: prefer vite.config.ts
  • Always use ESM, avoid CommonJS

Core

Topic Description Reference
Configuration vite.config.ts, defineConfig, conditional configs, loadEnv core-config
Features import.meta.glob, asset queries (?raw, ?url), import.meta.env, HMR API core-features
Plugin API Vite-specific hooks, virtual modules, plugin ordering core-plugin-api

Build & SSR

Topic Description Reference
Build & SSR Library mode, SSR middleware mode, ssrLoadModule, JavaScript API build-and-ssr

Advanced

Topic Description Reference
Environment API Vite 6+ multi-environment support, custom runtimes environment-api
Rolldown Migration Vite 8 changes: Rolldown bundler, Oxc transformer, config migration rolldown-migration

Quick Reference

CLI Commands

vite              # Start dev server
vite build        # Production build
vite preview      # Preview production build
vite build --ssr  # SSR build

Common Config

import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [],
  resolve: { alias: { '@': '/src' } },
  server: { port: 3000, proxy: { '/api': 'http://localhost:8080' } },
  build: { target: 'esnext', outDir: 'dist' },
})

Official Plugins

  • @vitejs/plugin-vue - Vue 3 SFC support
  • @vitejs/plugin-vue-jsx - Vue 3 JSX
  • @vitejs/plugin-react - React with Oxc/Babel
  • @vitejs/plugin-react-swc - React with SWC
  • @vitejs/plugin-legacy - Legacy browser support
FAQ

Does it cover the newest Vite version?

Yes. It is based on Vite 8 and explains the move to the Rolldown bundler.

Does it prefer TypeScript config files?

Yes. It prefers a vite.config.ts file and uses ES modules instead of CommonJS.

Can it help with server-side rendering?

Yes. The guidance covers server-side rendering and library mode.

Details

Original description by the author

Vite build tool configuration, plugin API, SSR, and Vite 8 Rolldown migration. Use when working with Vite projects, vite.config.ts, Vite plugins, or building libraries/SSR apps with Vite.

repo: antfu/skills

Popularity

GitHub stars
6.0k
Ranking position
#14445
License
MIT
Updated
10/30/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills