Install command
Provided
Optimize frontend build performance with Vite's lightning-fast HMR, code splitting, and tree-shaking. Modern build tooling that has replaced Webpack as the developer favorite.
Open the source and read safety notes before installing.
Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.
Decision playbook
Signals are comparatively strong, but you should still validate source, privacy posture, and package provenance for your environment.
0
96
—
No baseline selected
No major trust-signal divergence detected in the current selection.
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Source provenance statusRequired
Marked as first-party.
Metadata reviewed
Registry metadata indicates a reviewed listing.
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Trust level risk gateRequired
Trust level does not block evaluation.
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Package verification flag
Package marked verified.
Checksum metadata
SHA-256 hash is present.
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Baseline comparison available
No baseline peer selected yet.
Diverging trust signals identified
No major trust-signal divergence found.
Setup at a glance
Copy-ready — paste the snippet to get started.
Install command
Provided
Config snippet
Not provided
Copy snippet
Provided
Prerequisites
6 to clear
Platforms
6 listed
Difficulty
100/100
Adoption plan
Current risk score 0/100. Use staged verification before broader rollout.
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Confirm metadata review state
Listing has review metadata.
Verify install payload
Install/config payload exists and can be inspected.
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Review privacy notesRequired
Privacy notes are present.
Verify package integrity metadata
Package verification/checksum metadata is available.
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Evidence readiness
Required evidence gates are covered (6/6 signals complete).
Source repository/provenance is listed.
Required in this preset
Review metadata is present.
Required in this preset
Safety notes are present.
Required in this preset
Privacy notes are present.
Optional in this preset
Package integrity metadata is present.
Optional in this preset
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
6/6 steps complete with no blocking gaps for this preset.
triage
Source/provenance metadata is available.
triage
Review metadata is available.
verify
Safety notes are available.
verify
Privacy notes are available.
verify
Package integrity metadata is available.
rollout
Install payload is available.
No required blockers for this timeline preset.
Prerequisite readiness
6 prerequisites to line up before setup.
Safety & privacy surface
1 safety and 1 privacy notes across 2 risk areas. Review closely: credentials & tokens.
| Platform | Support | Install path |
|---|---|---|
| claude-code | Native | .claude/skills/<skill-name>/SKILL.md |
| codex | Native | .agents/skills/<skill-name>/SKILL.md |
| windsurf | Native | .windsurf/skills/<skill-name>/SKILL.md |
| gemini | Native | .gemini/skills/<skill-name>/SKILL.md or .agents/skills/<skill-name>/SKILL.md |
| cursor | Adapter | .cursor/rules/<skill-name>.mdc |
| cli | Manual | AGENTS.md or tool-specific context file |
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { visualizer } from 'rollup-plugin-visualizer';
export default defineConfig({
plugins: [
react(),
visualizer({ open: true, filename: 'dist/stats.html' }),
],
build: {
target: 'es2020',
sourcemap: 'hidden',
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes('node_modules/react') || id.includes('node_modules/react-dom')) {
return 'vendor-react';
}
if (id.includes('node_modules/@mui') || id.includes('node_modules/@emotion')) {
return 'vendor-ui';
}
if (id.includes('node_modules/lodash') || id.includes('node_modules/date-fns')) {
return 'vendor-utils';
}
},
},
},
cssCodeSplit: true,
minify: 'terser',
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
},
},
},
optimizeDeps: {
include: ['react', 'react-dom'],
},
});Claude can optimize your Vite build configuration for production-ready performance with instant Hot Module Replacement (HMR), intelligent code splitting, and tree-shaking. Vite leverages native ES modules during development and Rollup for optimized production builds, delivering the fastest developer experience while generating highly optimized bundles. From configuring build options to debugging bundle size, Claude handles the complexity of modern frontend tooling.
SKILL.md.SKILL.md content as reusable workflow instructions..gemini/skills/<skill-name>/SKILL.md or .agents/skills/<skill-name>/SKILL.md where supported..cursor/rules/*.mdc adapter for project rules.Required:
What Claude handles automatically:
Prompt: "Optimize my Vite config for production with: code splitting by route, lazy loading for heavy components, CSS extraction, source maps, and tree-shaking. Target modern browsers (ES2020)."
Claude will:
Prompt: "My Vite bundle is 2MB. Help me analyze what's taking space and optimize. Use rollup-plugin-visualizer and suggest splitting strategies."
Claude will:
Prompt: "Configure Vite for multi-page app with 3 entry points: landing page, dashboard, admin panel. Each should have separate bundles but share common dependencies."
Claude will:
Prompt: "Set up Vite with React, TypeScript, PWA support, image optimization, and SVG imports. Optimize for fastest dev server startup and HMR."
Claude will:
Use Manual Chunks Wisely: Split vendors by update frequency. React/Vue rarely change, but business logic does. Use manualChunks to separate stable from volatile code.
Lazy Load Heavy Libraries: Import chart libraries, rich editors, or large UI components dynamically only when needed. Vite handles code splitting automatically.
Optimize Dependencies: Use optimizeDeps.include for dependencies that slow down dev server startup. Pre-bundle CJS dependencies to ESM.
Environment Variables: Use import.meta.env (not process.env). Prefix with VITE_ to expose to client code. Use .env.local for secrets.
Source Maps in Production: Use hidden-source-map for error tracking without exposing code. Never use inline-source-map in production.
CSS Optimization: Enable build.cssCodeSplit for route-based CSS. Use PostCSS for autoprefixer and minification.
"Optimize Vite build for React app with 50+ routes:
1. Implement route-based code splitting with React.lazy()
2. Split vendor chunks: react/react-dom, UI library, utilities
3. Configure dynamic imports for modals, charts, editors
4. Add preload hints for critical chunks
5. Enable CSS code splitting per route
6. Configure build.rollupOptions for optimal chunking
7. Add bundle analyzer and aim for <200KB initial load
8. Set up Lighthouse CI to track performance"
"Configure Vite in Turborepo monorepo:
1. Shared vite.config.base.ts for common config
2. App-specific configs extending base
3. Shared component library with optimized exports
4. Configure path aliases for @workspace packages
5. Set up cache strategy for unchanged packages
6. Optimize prebundling for internal dependencies
7. Configure dev server proxy for backend services
8. Add workspace-aware HMR"
"Set up Vite PWA with offline support:
1. Install vite-plugin-pwa with Workbox
2. Configure service worker precaching strategy
3. Add runtime caching for API calls
4. Set up offline fallback page
5. Generate web manifest with icons
6. Configure update notification for new versions
7. Optimize caching based on file types
8. Add service worker update lifecycle"
"Configure Vite for component library build:
1. Set build.lib mode with entry point
2. Configure external dependencies (React, Vue)
3. Generate ESM and UMD bundles
4. Add TypeScript declaration generation
5. Set up CSS extraction and modules
6. Configure tree-shaking for optimal imports
7. Add source maps for debugging
8. Set up package.json exports field"
Issue: "Dev server slow to start with large dependencies"
Solution: Add slow dependencies to optimizeDeps.include array. Use server.warmup to prebundle commonly used files. Check for circular dependencies. Consider using optimizeDeps.esbuildOptions.target to skip unnecessary transforms.
Issue: "HMR not working for certain components"
Solution: Check component exports are named (not default). Ensure no side effects in module scope. Add HMR boundaries with import.meta.hot.accept(). Verify vite-plugin-react is installed for React Fast Refresh.
Issue: "Production bundle size larger than expected"
Solution: Run bundle analyzer to identify heavy dependencies. Check for duplicate dependencies in node_modules. Use dynamic imports for heavy libs. Verify tree-shaking with build.rollupOptions.treeshake. Check for unintentional global imports.
Issue: "Environment variables not accessible in client"
Solution: Prefix variables with VITE_ in .env file. Use import.meta.env.VITE_VAR_NAME not process.env. Check .env file is in project root. Restart dev server after adding new env vars.
Issue: "Build fails with 'Cannot find module' errors" Solution: Check path aliases in vite.config.ts match tsconfig.json. Verify resolve.alias configuration. Ensure all imports use correct file extensions. Check for case-sensitive file naming issues.
Show that Vite Frontend Build Performance Optimization Skill is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/skills/vite-build-optimization)Vite Frontend Build Performance Optimization Skill side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
3 trust signals differ across this comparison (Package trust, Source provenance, Submitter).
Next steps differ across entries — use the actions in the table below to copy install commands and source links per resource.
| Field | Optimize frontend build performance with Vite's lightning-fast HMR, code splitting, and tree-shaking. Modern build tooling that has replaced Webpack as the developer favorite. Open dossier | Analyze and optimize PostgreSQL queries for OLTP and OLAP workloads with AI-assisted performance tuning, indexing strategies, and execution plan analysis. Open dossier | Build JavaScript and TypeScript apps with Bun, an all-in-one toolchain that replaces Node.js, npm, a bundler, and a test runner with one fast binary that executes TypeScript directly. Open dossier | Expert capability pack for reviewing Claude Code autoMode settings blocks, trusted infrastructure prose, classifier rule overrides, and documented claude auto-mode CLI inspection before enabling permission-free auto mode. Open dossier |
|---|---|---|---|---|
| Next stepsDiffers | ||||
| Trust | ||||
| Review status | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed | ReviewedMaintainer reviewed |
| Package trustDiffers | Package verified2025-10-23 | Package verified2025-10-16 | Package verified2025-10-23 | Package not verified |
| Source provenanceDiffers | Source-backed | No submission link | No submission link | Submission linkedSource submission |
| SubmitterDiffers | — | — | — | kiannidev |
| Install risk | Review first | Low risk | Low risk | Review first |
| Notes | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ | Safety ✓ Privacy ✓ |
| Brand | — | — | — | — |
| Category | skills | skills | skills | skills |
| Source | first-party | first-party | first-party | source-backed |
| Author | JSONbored | JSONbored | JSONbored | kiannidev |
| Added | 2025-10-23 | 2025-10-16 | 2025-10-23 | 2026-06-16 |
| Platforms | Claude CodeCodexWindsurfGeminiCursorCLI | Claude CodeCodexWindsurfGeminiCursorCLI | Claude CodeCodexWindsurfGeminiCursorCLI | Claude CodeCodexWindsurfGeminiCursorCLI |
| Source repo | — | — | — | — |
| Safety notes | ✓Scaffolds and runs Vite (npm create vite, install, dev/build/preview servers that listen on a port and install dependencies); review plugins and config before running. | ✓Setup downloads/unzips a package, and the skill connects to your database to run EXPLAIN ANALYZE and create indexes; index builds and config changes can lock tables and affect production — test against a replica or staging first. | ✓Installing Bun globally (`npm install -g bun`) adds a runtime to your system; install from the official npm package or bun.sh and keep it updated. Bun runs JavaScript/TypeScript with full system access like Node.js; review code before executing it, especially untrusted scripts. | ✓Omitting $defaults from autoMode arrays replaces entire built-in rule lists per docs. Developer-added allow entries can override organization soft_deny rules—use managed permissions.deny for non-negotiable blocks. Auto mode runs without routine permission prompts; permissions.deny still blocks before the classifier. |
| Privacy notes | ✓Vite exposes only env vars prefixed VITE_ to client code — keep secrets unprefixed/server-side, and review what build config and source maps embed before publishing. | ✓Query analysis can surface table/column names and sample row values from your database; keep connection strings and credentials in environment variables and review what plans/output you share. | ✓Bun apps you build can read local files, environment variables, and make network calls like any Node.js app; keep secrets in environment variables and review what your code sends externally. | ✓autoMode.environment prose may describe internal hostnames and bucket names—redact external copies. Recently denied actions in /permissions may expose attempted commands—handle logs internally. Managed settings distribution exposes organization infrastructure descriptions to enrolled clients. |
| Prerequisites |
|
|
|
|
| Install | | | | — |
| Config | — | — | — | — |
| Citations | ||||
| Claim | Unclaimed | Unclaimed | Unclaimed | Unclaimed |
Source-backed guides for putting this to work.
Control MCP tool output size with env limits, annotations, and tool search to protect Claude Code context.
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.