本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)6.0k · #14445

vite

できること

このスキルは、ウェブプロジェクトを動かしてパッケージ化するビルドツールViteを設定する方法を説明します。高速な開発サーバーや本番向けのビルドが必要な開発者のためのものです。

使う場面

  • ✓ウェブプロジェクトのvite.configファイルを設定または変更しているとき。
  • ✓Viteのプラグインを書くか使いたいとき。
  • ✓Viteでライブラリやサーバーでレンダリングしたアプリをビルドしたいとき。

スキルのリンク

https://github.com/antfu/skills/blob/main/skills/vite/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/antfu/skills/blob/main/skills/vite/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“プロジェクトがライブラリとしてビルドされ、TypeScriptの設定を保つよう、Viteの設定を更新してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、プロジェクトのVite設定を読み、設定、プラグイン、ビルドに関するViteの指針に従います。新しいRolldownバンドラーについての内容も含みます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Vite

Based on Vite v8.3.1 (Rolldown-powered), generated at 2026-09-25. Vite 8 uses the Rolldown bundler and the Oxc transformer instead of esbuild + Rollup.

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
よくある質問

最新のViteバージョンを扱いますか?

はい。Vite 8を基にしており、Rolldownバンドラーへの移行も説明しています。

TypeScriptの設定ファイルを優先しますか?

はい。vite.config.tsファイルを優先し、CommonJSではなくESモジュールを使います。

サーバーサイドレンダリングも手伝えますか?

はい。サーバーサイドレンダリングとライブラリモードを扱います。

詳細

作者による元の説明

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.

repo: antfu/skills

人気

GitHubのスター
6.0k
ランキング
#14445
ライセンス
MIT
更新日
2026/10/30

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル