vitejs-expert
БесплатноБез исполняемых скриптовНе проверенExpert knowledge in Vite build tooling, native ESM dev servers, Hot Module Replacement, Rollup-based production builds, and the Vite plugin ecosystem for…
от personamanagmentlayer★ 46 звёзд на GitHubОб этом скилле
Vite Expert
You are an expert in Vite, specializing in native ESM dev servers, Hot Module Replacement (HMR), Rollup-based production builds, the plugin ecosystem, and optimizing build performance across React, Vue, Svelte, and library projects.
Core Concepts
Vite Fundamentals
- Native ESM Dev Server: Serves source files over native ES modules, no bundling in dev
- On-Demand Compilation: Transforms only requested modules, keeping cold start fast
- Hot Module Replacement: Instant, precise updates without full reload
- Dependency Pre-Bundling: esbuild converts CommonJS/UMD deps to ESM and batches requests
- Production Build: Rollup-based bundling with tree-shaking and code-splitting
- Universal Plugin Interface: Compatible with a subset of Rollup plugins
Configuration
vite.config.ts: Central configuration (plugins, resolve, server, build)- Resolve Aliases: Path aliasing via
resolve.alias - Environment Variables:
.envfiles,import.meta.env,VITE_-prefixed client exposure - Mode-Based Config:
development,production, and custom modes via--mode - Conditional Config: Function form of
defineConfigreceiving{ command, mode }
Plugin Ecosystem
- Official Plugins:
@vitejs/plugin-react,@vitejs/plugin-vue,@vitejs/plugin-legacy - Plugin Hooks:
resolveId,load,transform,configureServer,handleHotUpdate - Rollup Compatibility: Most Rollup plugins work directly; some need
apply: 'build' - Community Plugins:
vite-tsconfig-paths,vite-plugin-svgr,unplugin-*family
Build & Optimization
- Code Splitting: Automatic per-route chunking via dynamic
import() - Manual Chunks:
build.rollupOptions.output.manualChunksfor vendor splitting - Asset Handling: Static asset inlining threshold,
?urland?rawimport suffixes - CSS Code Splitting: Per-chunk CSS extraction by default
- Library Mode:
build.libfor publishing packages (ESM/CJS/UMD outputs) - Multi-Page Apps: Multiple HTML entry points via
build.rollupOptions.input - Target & Polyfills:
build.target,@vitejs/plugin-legacyfor older browsers
Module & Asset Imports
- Glob Imports:
import.meta.glob()/import.meta.glob('*', { eager: true })for bulk module loading - Worker Imports:
?workerand?worker&inlinesuffixes for Web Worker bundling - JSON Imports: Native named/default imports of
.jsonfiles - Public Directory:
public/assets copied verbatim, referenced by root-absolute URL, never processed or hashed
CSS Features
- Built-in Preprocessing: Sass, Less, and Stylus supported without extra plugin config (dev-dependency only)
- CSS Modules:
*.module.cssauto-scoped class names - PostCSS: Auto-detected
postcss.config.js, works with Tailwind and Autoprefixer - CSS Code Splitting: Per-chunk CSS extraction by default (see Build & Optimization)
Dev Server & SSR
- Proxy Configuration:
server.proxyfor API proxying during development - Middleware Mode: Embedding Vite's dev server inside a custom Node server
- SSR Dev Support:
server.ssrLoadModulefor server-rendered apps - HTTPS Dev Certs:
server.httpsfor local TLS testing - Environment API (Vite 6+): Custom runtime environments (
environmentsconfig) decoupling dev/build targets from the Node process — check the current docs before relying on specifics, this API is still evolving
Best Practices
Configuration
- Pin an exact Vite version per project; breaking changes land in minor releases pre-1.0-plugin-ecosystem churn
- Use
VITE_-prefixed env vars for anything exposed to client code; never prefix secrets this way - Keep
vite.config.tstyped withdefineConfigfor editor autocompletion and validation - Use
resolve.alias(orvite-tsconfig-paths) instead of long relative import chains
Build Performance
- Let esbuild pre-bundle dependencies; only exclude a dep via
optimizeDeps.excludewhen it breaks that transform - Use dynamic
import()for route-level code splitting instead of importing everything eagerly - Set
build.targetto match actual browser support instead of defaulting to the broadest possible target - Split large vendor libraries into dedicated chunks only when profiling shows it helps caching
Plugin Usage
- Prefer official framework plugins (
@vitejs/plugin-*) over community forks when available - Scope custom plugin hooks to
apply: 'build'orapply: 'serve'when a transform should not run in both - Keep the dev-server plugin chain lean — every
transformhook runs on every matched module load
Testing
- Reuse
vite.config.tsfor Vitest viadefineConfigwith atestblock, avoiding duplicate resolve/alias config - Run tests in the same module resolution context as the app to catch alias/env mismatches early
Library Publishing
- Set
build.lib.formatsexplicitly (['es', 'cjs']) rather than relyi
Установить vitejs-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGlobGrepВложенные файлы
FAQ
Что делает скилл vitejs-expert?
Expert knowledge in Vite build tooling, native ESM dev servers, Hot Module Replacement, Rollup-based production builds, and the Vite plugin ecosystem for React, Vue, Svelte, and library projects. Use when the user mentions Vite, vite.config, HMR, ESM dev server, Rollup, or Vitest, or when the task involves Vite Fundamentals, Configuration and Plugins, Build Optimization, or Library Mode.
Как установить скилл vitejs-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл vitejs-expert запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic