Skip to main content
skill CX Codex

vite-advanced — Claude Code skill: what it does, how to install

vite-advanced is a Claude Code and Codex skill for Vite 8 builds with Rolldown, chunk splitting, and Environment API. It activates when editing vite.config.* or files under **/vite/**.

MIT 265 installs ★ 305 updated 2026-11-21

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add yonatangross/orchestkit --skill vite-advanced -a claude-code
Open on GitHub

What vite-advanced does

This skill guides the agent through Vite 8 configurations built on the Rust-based Rolldown bundler. It handles the shift from manualChunks to advancedChunks, updates options to rolldownOptions, and structures multi-target setups with the Environment API.

It enforces specific production guardrails: generating maps with sourcemap: 'hidden' to avoid exposing source code, preserving chunk group names to keep client cache valid after upgrades, and preventing secret exposure inside VITE_ build variables.

The setup requires Vite 8.3.1 or higher and Claude Code 2.1.277+. Before debugging custom plugin logic, it specifies clearing stale pre-bundles via rm -rf node_modules/.vite && vite --force.

What it helps with

  • migrate existing projects to Vite 8 and Rolldown
  • split output bundles using advancedChunks group syntax
  • configure multi-environment outputs for SSR and edge workers
  • set up library mode exports with dual ESM and CJS builds

Example prompts for the agent

  • Update vite.config.ts for Vite 8 and organize groups in advancedChunks
  • Configure the Environment API for distinct client and SSR builds
  • Prepare Vite library mode with proper entry points and TypeScript types

How to install vite-advanced

1Skills CLI (Vercel)

npx skills add yonatangross/orchestkit --skill vite-advanced -a claude-code

2Manually: put the files in place

~/.claude/skills/vite-advanced/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/vite-advanced/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about vite-advanced

How to install vite-advanced in Claude Code?

Run npx skills add yonatangross/orchestkit --skill vite-advanced -a claude-code. The skill file will be placed in ~/.claude/skills/vite-advanced/SKILL.md.

What does vite-advanced do?

It equips the agent with guidelines for Vite 8, Rolldown options, custom plugin hooks, and chunk splitting rules.

What are the requirements for vite-advanced?

The project must run Vite 8.3.1 or newer, alongside Claude Code version 2.1.277+.

Source text

SKILL.md · MIT
---
name: vite-advanced
license: MIT
compatibility: "Claude Code 2.1.277+."
description: "Advanced Vite 8 patterns: Rolldown builds, advancedChunks, Environment API, plugin development, SSR, library mode, build optimization. Use when customizing build pipelines, creating plugins, or configuring multi-environment builds."
user-invocable: false
targets:
  - library: vite
    version: ">=8.3.1"
metadata:
  archive-candidate: "pending an outside usage signal"
  owner-agent: "frontend-ui-developer"
  category: document-asset-creation
  vite-version: "8.0"
  version: "2.0.0"
  author: "OrchestKit"
  complexity: "medium"
  tags: "vite, vite8, rolldown, build, bundler, plugins, ssr, library-mode, environment-api, optimization, advancedchunks"
allowed-tools: "Read Glob Grep WebFetch WebSearch"
path_patterns: ["vite.config.*", "**/vite/**"]
---

# Vite Advanced Patterns

A wrapper around **Vite 8** (Rolldown-powered), not a copy of its documentation.
Vite's own docs are the source of truth for config keys, API surface, and migration
mechanics. This skill carries the house delta plus four enforceable rules.

Vite 8 replaces the esbuild+Rollup pipeline with **Rolldown** (Rust-based unified
bundler) and is the default for new projects. `advancedChunks` supersedes
`manualChunks`; `build.rollupOptions` becomes `build.rolldownOptions`.

## Upstream coverage (do not restate)

Fetch these from Vite rather than expecting them here. Rows marked with a rule keep a
narrower, enforceable house subset in that rule file: read the rule for the house
position, fetch the doc for the full API.

| Topic | Fetch from |
|-------|------------|
| Vite 7 to 8 migration: `rolldownOptions`, `transformWithOxc`, `moduleType: 'js'`, removed hooks and output formats, browser target bumps | https://vite.dev/guide/migration |
| Rolldown adoption path, `rolldown-vite`, Oxc, `advancedChunks` group syntax (house subset stays in `rules/vite-advanced-chunks.md`) | https://vite.dev/guide/rolldown |
| Build options: `target`, `minify`, `sourcemap`, `cssCodeSplit`, `cssMinify`, `assetsInlineLimit`, `chunkSizeWarningLimit` | https://vite.dev/config/build-options |
| Dependency pre-bundling and `optimizeDeps` include/exclude/force | https://vite.dev/guide/dep-pre-bundling |
| SSR: client and server entry points, middleware-mode dev server, production server wiring, streaming | https://vite.dev/guide/ssr |
| Environment API config and per-environment build output (house subset stays in `rules/vite-environments.md`) | https://vite.dev/guide/api-environment |
| Environment API for plugins: `this.environment`, `perEnvironmentPlugin`, `applyToEnvironment` | https://vite.dev/guide/api-environment-plugins |
| Environment API for frameworks: `createBuilder`, `buildApp`, `ModuleRunner` | https://vite.dev/guide/api-environment-frameworks |
| Plugin hook reference, virtual modules, `enforce`/`apply`, `handleHotUpdate` (house subset stays in `rules/vite-plugin-hooks.md`) | https://vite.dev/guide/api-plugin |
| Env variables and modes, `.env` files, the `VITE_` prefix | https://vite.dev/guide/env-and-mode |
| Deploying a static site and verifying with `vite preview` | https://vite.dev/guide/static-deploy |

Library mode is not in the table: `references/library-mode.md` and
`rules/vite-lib-config.md` still carry it in full.

## House delta

Read `references/ork-delta.md` for the rules Vite's docs do not
state: the Vite 8 adoption path for existing production apps, the `VITE_` secrets
rule, the production sourcemap setting, the house build budget, the `vite preview`
gate, chunk-name stability across the `advancedChunks` migration, the visualizer
diff requirement, and the `node_modules/.vite` cache-clearing step.

## House config

Not a Vite tutorial: these are the settings the delta above makes non-negotiable, in the
shape we actually ship them.

```ts
// vite.config.ts
import { defineConfig } from 'vite';

export default defineConfig({
  build: {
    // 'hidden' emits maps for the error reporter without publishing source.
    // Never true (publishes source) and never 'inline' (inflates every JS file).
    sourcemap: 'hidden',
    rollupOptions: {
      output: {
        // Carry existing chunk NAMES across the manualChunks to advancedChunks
        // migration. A renamed group changes its filename and invalidates that
        // chunk for every returning visitor, even with identical contents.
        advancedChunks: {
          groups: [
            { name: 'vendor', test: /node_modules/, priority: 10 },
            { name: 'app', priority: 0 },
          ],
        },
      },
    },
  },
});
```

```bash
# Prove the build. `vite build` exiting 0 means the bundler finished, not that the
# app runs: base-path mistakes and dev-only env vars survive a green build.
vite build && vite preview      # then walk the routes, console must be clean

# Diff the chunk graph before and after any chunk-config change.
npx vite-bundle-visualizer

# Stale pre-bundle cache mimics a broken plugin. Clear it BEFORE editing plugin code.
rm -rf node_modules/.vite && vite --force
```

> `VITE_`-prefixed variables are inlined into the client bundle at build time. They are
> public bundle content, never secrets. Audit `.env.production` before deploy.

## Rules

| Rule | Covers |
|------|--------|
| `rules/vite-advanced-chunks.md` | Chunk splitting: `advancedChunks` groups, priority, `maxSize`, `minShareCount` |
| `rules/vite-environments.md` | `environments` config for client, SSR, and edge; per-environment `outDir` |
| `rules/vite-lib-config.md` | Library mode externals, dual ESM/CJS output, `exports` map, type declarations |
| `rules/vite-plugin-hooks.md` | Hook order, virtual modules via `resolveId` + `load`, `enforce` and `apply` |

## Key Decisions

| Decision | Recommendation |
|----------|----------------|
| New projects | **Vite 8** (default) |
| Existing production apps | Stage the upgrade through `rolldown-vite` before committing |
| Multi-env builds | Environment API (`environments` config) |
| Plugin scope | Use `this.environment` for env-aware plugins |
| SSR | Middleware mode for dev, separate builds for prod |
| Chunks | `advancedChunks` for Vite 8, `manualChunks` for Vite 7 compat |

## Related Skills

- `ork:react-server-components-framework` - SSR integration
- `ork-extras:storybook-testing` - Component testing with Vitest
- `ork:performance` - Core Web Vitals targets behind the build budget

## References

Load on demand with `Read("references/<file>")`:

| File | Content |
|------|---------|
| `ork-delta.md` | House rules that Vite's docs do not state |
| `library-mode.md` | Building publishable npm packages |

© OrchestKit · MIT · yonatangross/orchestkit

Similar skills

All skills for Frontend and UI →

From the same set86

The whole set →
langgraph Skill for Claude Code supplies workflow patterns for LangGraph 1.x in Python. It steps in when designing multi-agent graphs, state schemas, and fault tolerance policies. CX Codex +1 377installs write-prd write-prd generates 8-section product requirements documents with INVEST user stories, acceptance criteria, and go/no-go gates. Writes the final specification to PRD-[product-name].md. CX Codex +1 336installs distributed-systems distributed-systems is a Claude Code skill with architectural guidelines for distributed locks, circuit breakers, idempotency keys, and rate limiting. CX Codex +1 297installs monitoring-observability monitoring-observability — a skill for Claude Code that configures Prometheus metrics, Grafana dashboards, and Langfuse v4 tracing. Activates when adding logging, distributed tracing, or LLM cost tracking. CX Codex +1 270installs quality-gates quality-gates scores task complexity on a 1–5 scale and halts work when requirements are vague or solutions loop. Triggers before complex tasks and after repeated failures. CX Codex +1 259installs code-review-playbook code-review-playbook supplies structured review workflows, conventional comment formats, and security checklists. Triggers during pull request evaluations or author self-reviews. CX Codex +1 254installs python-backend python-backend — a skill for Claude Code and Codex providing async Python patterns when editing *.py or package files. Enforces conventions for FastAPI, SQLAlchemy 2.0, and asyncio. CX Codex +1 250installs accessibility accessibility — a Claude Code skill for building accessible web interfaces. It activates for work on screen reader support, keyboard navigation, focus handling, and ARIA components. CX Codex +1 246installs

Project sponsors

Companies that keep this analytics open