Vite Configuration, Plugins, SSR

VerifiedSafe

Guide for Vite, a modern frontend build tool. Covers configuration, plugin API, SSR, and Rolldown migration.

Sby Skills Guide Bot
DevelopmentIntermediate
7/31/2026
Claude CodeCursorCodex
#vite#bundler#frontend-build#ssr#rolldown

Recommended for

Automated summary

A reference skill that guides Vite configuration, plugin authoring, library/SSR builds, and the migration to Rolldown-powered Vite 8.

Strengths

  • Covers Vite core: vite.config.ts, import.meta.glob, asset queries, and the HMR API
  • Explains the plugin API in depth, including Vite-specific hooks, virtual modules, and plugin ordering
  • Includes library mode, SSR middleware mode, ssrLoadModule, and the JavaScript API
  • Ships a dedicated Vite 8 migration reference covering Rolldown and the Oxc transformer

Limitations

  • Based on the Vite 8 beta, so some configuration details may still change
  • Mostly an index pointing at reference files, with limited inline depth
  • Does not cover build-error debugging or framework-specific setups such as Nuxt or SvelteKit
When to use it

Use it whenever you edit a vite.config.ts, write a Vite plugin, or set up an SSR or library build.

When not to use it

Skip it for projects on another bundler (webpack, plain Rollup, esbuild) or for runtime debugging unrelated to build configuration.

Security analysis

Safe
Quality score92/100

The skill is a documentation and reference guide for Vite. It contains no executable commands beyond standard build CLI examples, no network exfiltration, destructive actions, or obfuscated payloads. No tools are declared, and the content is purely informational.

No concerns found

How this analysis is made

Examples

Config with alias and proxy
Add a '@' alias to /src and a dev proxy for /api to http://localhost:8080 in my vite.config.ts, keeping the file TypeScript and ESM.
Write a virtual module plugin
Write a Vite plugin that exposes a virtual module 'virtual:app-config' returning build-time info, including the resolveId and load hooks and the TypeScript declaration.
Migrate to Vite 8 Rolldown
Walk me through migrating this Vite 5 project to Vite 8 with Rolldown and Oxc — what config changes and plugin incompatibilities should I look for?

name: vite description: Vite build tool configuration, plugin API, SSR, and Vite 8 Rolldown migration. Use when working with Vite projects, vite.config.ts, Vite plugins, or building libraries/SSR apps with Vite. metadata: author: Anthony Fu version: "2026.1.31" source: Generated from https://github.com/vitejs/vite, scripts at https://github.com/antfu/skills

Vite

Based on Vite 8 beta (Rolldown-powered). Vite 8 uses Rolldown bundler and Oxc transformer.

Vite is a next-generation frontend build tool with fast dev server (native ESM + HMR) and optimized production builds.

Preferences

  • Use TypeScript: prefer vite.config.ts
  • Always use ESM, avoid CommonJS

Core

| Topic | Description | Reference | |-------|-------------|-----------| | Configuration | vite.config.ts, defineConfig, conditional configs, loadEnv | core-config | | Features | import.meta.glob, asset queries (?raw, ?url), import.meta.env, HMR API | core-features | | Plugin API | Vite-specific hooks, virtual modules, plugin ordering | core-plugin-api |

Build & SSR

| Topic | Description | Reference | |-------|-------------|-----------| | Build & SSR | Library mode, SSR middleware mode, ssrLoadModule, JavaScript API | build-and-ssr |

Advanced

| Topic | Description | Reference | |-------|-------------|-----------| | Environment API | Vite 6+ multi-environment support, custom runtimes | environment-api | | Rolldown Migration | Vite 8 changes: Rolldown bundler, Oxc transformer, config migration | rolldown-migration |

Quick Reference

CLI Commands

vite              # Start dev server
vite build        # Production build
vite preview      # Preview production build
vite build --ssr  # SSR build

Common Config

import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [],
  resolve: { alias: { '@': '/src' } },
  server: { port: 3000, proxy: { '/api': 'http://localhost:8080' } },
  build: { target: 'esnext', outDir: 'dist' },
})

Official Plugins

  • @vitejs/plugin-vue - Vue 3 SFC support
  • @vitejs/plugin-vue-jsx - Vue 3 JSX
  • @vitejs/plugin-react - React with Oxc/Babel
  • @vitejs/plugin-react-swc - React with SWC
  • @vitejs/plugin-legacy - Legacy browser support

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/vite-configuration-plugins-ssr-ms8gxngm/download' --output '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md.part' && mv '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md.part' '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Original excerpt: Quick Reference

CLI Commands

vite              # Start dev server
vite build        # Production build
vite preview      # Preview production build
vite build --ssr  # SSR build

Common Config

import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [],
  resolve: { alias: { '@': '/src' } },
  server: { port: 3000, proxy: { '/api': 'http://localhost:8080' } },
  build: { target: 'esnext', outDir: 'dist' },
})

Official Plugins

  • @vitejs/plugin-vue - Vue 3 SFC support
  • @vitejs/plugin-vue-jsx - Vue 3 JSX
  • @vitejs/plugin-react - React with Oxc/Babel
  • @vitejs/plugin-react-swc - React with SWC
  • @vitejs/plugin-legacy - Legacy browser support

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md' && test -s '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/vite' && cp -R '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm' '.claude/skills/vite'

Cursor
test -f '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md' && test -s '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/vite' && cp -R '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm' '.cursor/skills/vite'

Codex
test -f '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md' && test -s '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/vite' && cp -R '.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm' '.agents/skills/vite'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/vite-configuration-plugins-ssr-ms8gxngm'

openskills read 'vite-configuration-plugins-ssr-ms8gxngm'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/vite-configuration-plugins-ssr-ms8gxngm/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills