オプション

Vite ビルドツールを設定し、そのプラグイン API を使用し、SSR をセットアップし、Rolldown を使って Vite 8 へ移行します。

...すべて拡張します
10
更新された時間 2026年9月6日

Vite

Vite 8 ベータ版(Rolldown 搭載)をベースとしています。Vite 8 では、Rolldown バンドラーと Oxc トランスフォーマーが使用されています。

Vite は、高速な開発用サーバー(ネイティブ ESM + HMR)と最適化された本番ビルドを備えた、次世代のフロントエンドビルドツールです。

設定

  • TypeScriptを使用:優先 vite.config.ts
  • 常に ESM を使用し、CommonJS は使用しない

コア

トピック 説明 リファレンス
設定 vite.config.ts, defineConfig、条件付き設定、 loadEnv コア設定
機能 import.meta.glob、アセットクエリ(?raw, ?url), import.meta.env、HMR API コア機能
プラグインAPI Vite- プラグイン固有のフック、仮想モジュール、プラグインの順序設定 コア・プラグイン・API

ビルドとSSR

トピック 説明 リファレンス
ビルドとSSR ライブラリモード、SSR ミドルウェアモード、 ssrLoadModule、JavaScript API build-and-ssr

詳細

トピック 説明 リファレンス
環境 API Vite 6+ マルチ環境対応、カスタムランタイム environment-api
ロールダウン移行 Vite 8件の変更:Rolldownバンドラー、Oxcトランスフォーマー、設定の移行 rolldown-migration

クイックリファレンス

CLI コマンド

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

一般的な設定

import { defineConfig } from 'vite'

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

公式プラグイン

  • @vitejs/plugin-vue - Vue 3 SFC サポート
  • @vitejs/plugin-vue-jsx - Vue 3 の JSX
  • @vitejs/plugin-react - Oxc/Babel を使用した React
  • @vitejs/plugin-react-swc - SWC を使用した React
  • @vitejs/plugin-legacy - 旧式ブラウザへの対応
GitHubで見る
---
name: vite
description: Configure Vite build tool, use its plugin API, set up SSR, and migrate to Vite 8 with Rolldown.
---

# 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](references/core-config.md) |
| Features | `import.meta.glob`, asset queries (`?raw`, `?url`), `import.meta.env`, HMR API | [core-features](references/core-features.md) |
| Plugin API | Vite-specific hooks, virtual modules, plugin ordering | [core-plugin-api](references/core-plugin-api.md) |

## Build & SSR

| Topic | Description | Reference |
|-------|-------------|-----------|
| Build & SSR | Library mode, SSR middleware mode, `ssrLoadModule`, JavaScript API | [build-and-ssr](references/build-and-ssr.md) |

## Advanced

| Topic | Description | Reference |
|-------|-------------|-----------|
| Environment API | Vite 6+ multi-environment support, custom runtimes | [environment-api](references/environment-api.md) |
| Rolldown Migration | Vite 8 changes: Rolldown bundler, Oxc transformer, config migration | [rolldown-migration](references/rolldown-migration.md) |

## Quick Reference

### CLI Commands

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

### Common Config

```ts
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

すべてのファイル

0件のファイル

viteをインストール

スキルファイルをダウンロードし、.claude/skills/ ディレクトリに解凍してください。

ZIPをダウンロード

リポジトリをクローンし、スキルファイルをプロジェクトにコピーしてください。

git clone https://github.com/antfu/skills/tree/main/skills/vite # Copy SKILL.md to your .claude/skills/ directory

コピー コピー
クイックセットアップ: スキルフォルダを .claude/skills/ にコピーしてください。 Claudeが自動的にスキルを検出して使用します。
リポジトリ antfu/skills

関連スキル

github-code-search
更新された時間 2026年6月29日
drizzle-orm
更新された時間 2026年6月29日
clickhouse-io
更新された時間 2026年6月29日
prisma-client-api
更新された時間 2026年6月29日
OR