微算力 · API 导航与自营网关
API 接入 EN
未登录登录
⚡

极速构建,深度可控

Vite · v1.0.0
开发 安全 S 级 作者 ivangdavila 公开目录收录
2.3k 下载 2 安装 4.8k 收藏 13 浏览

简介

Vite 现代前端构建工具的配置与优化指南,涵盖开发、生产构建及库打包的 12 类核心模式,适合追求极速 HMR 和精细化控制的开发者。

原始描述

Configure and optimize Vite for development, production builds, and library bundling.

通过你的 Agent 添加

安装目录:vite/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/vite/
Codex CLI~/.codex/skills/vite/
DeepSeek Harness~/.agents/skills/vite/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


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.1.31" source: Generated from https://github.com/vitejs/vite, scripts at https://github.com/antfu/skills

Vite

Based on Vite 8 beta (Rolldown-powered). Vite 8 uses Rolldown bundler and Oxc transformer.

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

正文来自原始仓库, 版权归作者所有,许可:GPL。 权利人认为有不妥,可申请下架。

原始仓库

作者的项目地址:https://github.com/debpalash/OmniVoice-Studio

标签

vitebuild-toolsbundleresmhmrfrontendrolluptypescriptdevelopment

同类 Skill