
Vite
SkillVite 8 构建工具的参考:vite.config.ts 配置、import.meta.glob 等特性、插件 API、库模式与 SSR、Environment API,以及改用 Rolldown 打包与 Oxc 转译后的迁移要点;偏好 TypeScript 配置与 ESM。由 Anthony Fu 从官方文档生成。
name: vite
description: 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.
metadata:
author: Anthony Fu
version: "2026.9.25"
source: Generated from https://github.com/vitejs/vite, scripts at https://github.com/antfu/skills
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
相關資源

Antfu Conventions
SkillAnthony Fu 对 JavaScript / TypeScript 项目的约定与工具偏好:代码组织、显式导入、Vitest 测试写法,以及 @antfu/ni、开启 antislop 的 @antfu/eslint-config、Knip、tsdown 和统一的 ci 脚本,新建项目时参照 antfu/starter-ts 模板。
antfu/skills6k
Nuxt
SkillNuxt 5 全栈 Vue 框架的参考:目录结构、配置、文件路由、useFetch 等数据获取、自动导入、服务端路由、渲染模式、SSR 与水合注意事项、模块与 Layers,重点说明 Nuxt 5 改用 Nitro v3 与 Vite 8 带来的变化。由 Anthony Fu 从官方文档生成。
antfu/skills6k
Vitest
SkillVitest 5 测试框架的参考:配置、命令行、test / describe / expect API、生命周期钩子,模拟、快照、覆盖率、测试上下文与 fixtures、并发、过滤与标签、报告器、基准测试,以及测试环境、类型测试与多项目配置。由 Anthony Fu 从官方文档生成。
antfu/skills6k
Deno
CLIJavaScript、TypeScript 与 WebAssembly 运行时,自带格式化、lint、测试与编译等工具;默认禁止脚本访问文件、网络与环境变量,需用 --allow-* 显式授权,便于较安全地运行 agent 生成的脚本。
denoland/deno109k
Bun
CLI一体化的 JavaScript/TypeScript 工具链:单个 bun 可执行文件同时是 Node.js 兼容运行时、包管理器、测试运行器与脚本运行器,安装依赖与跑测明显更快。
oven-sh/bun96.3k
JavaScript TypeScript
PluginJS/TS 开发插件:内置 javascript-pro、typescript-pro 两个子代理和 TypeScript 项目脚手架命令,外加现代 JS 写法、TS 高级类型、Node.js 后端、JS 测试 4 个技能。收录在 wshobson/agents 插件市场。
wshobson/agents41k