SKILL

vite-patterns

Vite build tool patterns including config, plugins, HMR, env variables, proxy setup, SSR, library mode, dependency pre-bundling, and build optimization. Activate when working with vite.config.ts, Vite plugins, or Vite-based projects.

Target: Target not categorized. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original Japanese text

Topics in the source

  • Vite パターン
  • 使用するタイミング
  • 動作の仕組み
  • 例
  • 設定の構造
  • 基本設定
  • 条件付き設定
  • 主要な設定オプション

Vite 8+ プロジェクトのビルドツールおよびデベロップメントサーバーのパターン。設定、環境変数、プロキシ設定、ライブラリモード、依存関係の事前バンドル、一般的な本番環境の落とし穴をカバー。 vite.config.ts または vite.config.js を設定するとき 環境変数または .env ファイルを設定するとき APIバックエンド用のデベロップメントサーバープロキシを設定するとき ビルド出力(チャンク、ミニファイ、アセット)を最適化するとき build.lib でライブラリを公開するとき 依存関係の事前バンドルまたはCJS/ESM相互運用のトラブルシューティングをするとき HMR、デベロップメントサーバー、またはビルドエラーをデバッグするとき Viteプラグインの選択または順序付けをするとき デベロップメントモードはソースファイルをネイティブESMとして提供します(バンドルなし)。変換はモジュールリクエストごとにオンデマンドで行われるため、コールドスタートが速くHMRが精確です。 ビルドモードはRolldown(v7+)またはRollup(v5〜v6)を使用して、ツリーシェイキング、コード分割、Oxcベースのミニファイでアプリを本番用にバンドルします。 依存関係の事前バンドルはesbuildを通じてCJS/UMD依存関係をESMに一度変換し、結果を nodemodules/.vite にキャッシュします。これにより後続の起動では処理をスキップできます。 プラグインはデベロップメントとビルドにわたって統一されたインターフェースを共有します。同じプラグインオブジェクトが、デベロップメントサーバーのオンデマンド変換と本番パイプラインの両方で機能します。 環境変数はビルド時に静的にインライン化されます。VITE プレフィックス付きの変数はバンドル内のパブリック定数になり、プレフィックスなしのものはクライアントコードから見えません。 | キー | デフォルト | 説明 | |-----|---------|-------------| | root | '.' | プロジェクトルート(index.html の場所) | | base | '/' | デプロイされたアセットのパブリックベースパス | | envPrefix | 'VITE' | クライアントに公開する環境変数のプレフィックス | | build.outDir | 'dist' | 出力ディレクトリ | | build.minify | 'oxc' | ミニファイアー('oxc'、'terser'、または false) | | build.sourcemap | false | true、'inline'、または 'hidden' | ほとんどのプラグインのニーズは、少数のよく管理されたパッ

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
affaan-m/ECC
Source file
docs/ja-JP/skills/vite-patterns/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:49.803Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.