Vite 7.x build tool patterns. Use when configuring build setup, development server, environment variables, asset handling, or optimizing production builds for React applications.
Vite 7.x build tool patterns. Use when configuring build setup, development server, environment variables, asset handling, or optimizing production builds for React applications.
Install command
npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill vite
Copy and paste this command into Claude Code to install the skill
Vite 7.x build tool patterns. Use when configuring build setup, development server, environment variables, asset handling, or optimizing production builds for React applications.
Vite
Platform: Web only. Mobile demos use Expo with Metro bundler. See the expo-sdk skill.
Use Context7 MCP (resolve-library-id then query-docs) for full API reference, plugin ecosystem, and advanced configuration options.
Overview
Build tool and development server for Vite 7.x. Provides instant server start, fast HMR, optimized production builds, and first-class TypeScript support.
Advanced function-based chunking — use when you need per-view splitting:
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('framer-motion')) return'vendor-animation';
if (id.includes('react')) return'vendor-react';
return'vendor';
}
}
PostCSS / Tailwind: Point css.postcss to your postcss.config.js. Enable cssCodeSplit: true (default) for large apps.
Asset handling:
// src/assets — processed by Vite (hashed, optimized)import logo from'@/assets/logo.svg';
// /public — served as-is, NOT processed<imgsrc="/images/logo.svg" />// ❌ Never import from public directory
Inline limit: Assets under 4 KB are inlined as base64 by default (assetsInlineLimit: 4096).
Base path for subdirectory hosting: base: '/my-app/'
Vite 7 Notes
Rolldown — new Rust-based bundler (optional, faster builds)
Improved TypeScript support and tree-shaking
Default config works for most projects; advanced bundler options rarely needed
Best Practices
Use path aliases to avoid ../../../ import hell
Prefix client env vars with VITE_ for automatic exposure
Split large vendors into separate chunks for better caching
Use .env.local for secrets — never commit to git
Configure proxy for API calls to avoid CORS in development
Preview builds before deploying: pnpm vite build && pnpm vite preview
Use esbuild for faster builds, terser for smaller output
Set strictPort: true to avoid silent port conflicts
Anti-Patterns
❌ Forgetting VITE_ prefix on environment variables
❌ Importing from /public directory instead of src/assets
❌ Committing .env.local with API keys
❌ Not configuring path aliases (messy imports)
❌ Using terser in development (unnecessary slowdown)