Assists with configuring and using Vite as a frontend build tool for modern web applications. Use when setting up dev servers, optimizing production builds, configuring plugins, migrating from Webpack or CRA, or building component libraries. Trigger words: vite, build tool, HMR, hot module replacement, vite config, rollup, bundling.
Vite is a next-generation frontend build tool providing instant dev server startup via native ES modules and optimized Rollup-based production builds. It supports React, Vue, Svelte, and vanilla TypeScript projects with advanced bundling strategies, plugin extensibility, and library mode.
vite.config.ts with the appropriate framework plugin (@vitejs/plugin-react, @vitejs/plugin-vue), configure resolve.alias with @ mapping to src/, and set environment variables with VITE_ prefix.server.proxy, enable HTTPS with @vitejs/plugin-basic-ssl, and use server.watch polling for containers or VMs.build.rollupOptions.output.manualChunks for vendor splitting, enable CSS code splitting, and set build.target for browser compatibility.resolveId, load, and transform hooks, and leverage virtual modules with the virtual: prefix.build.lib with entry point and output formats (es, cjs, umd), externalize peer dependencies, and use vite-plugin-dts for TypeScript declaration generation.webpack.config.js with vite.config.ts, swap loaders for Vite plugins, and update REACT_APP_* env vars to VITE_*.User request: "Convert my CRA project to use Vite instead"
Actions:
@vitejs/plugin-react, remove react-scriptsvite.config.ts with React plugin and path aliasesREACT_APP_* environment variables to VITE_*index.html to reference the entry module directlyOutput: A Vite-powered React project with faster dev startup and HMR.
User request: "Set up Vite build with vendor chunk splitting and source maps for Sentry"
Actions:
build.rollupOptions.output.manualChunks to separate vendor librariesbuild.sourcemap for error monitoring integrationbuild.target appropriate to browser support requirementsbuild.assetsInlineLimit tuning for small asset optimizationOutput: An optimized production build configuration with proper chunk splitting and debugging support.
import.meta.env.VITE_* for client-exposed env vars, never process.env.resolve.alias with @ prefix mapping to src/ for clean imports.build.target: "esnext" for modern-only apps, @vitejs/plugin-legacy for legacy browser support.build.sourcemap in production for error monitoring tools.vite.config.ts clean by extracting complex plugin configs into separate files.optimizeDeps.include to pre-bundle problematic dependencies that break during dev.npx skills add TerminalSkills/vite下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer