Skip to content

Installation

Core Package

Install @vite-env/core with your preferred schema validator:

sh
pnpm add @vite-env/core zod
sh
npm install @vite-env/core zod
sh
yarn add @vite-env/core zod
sh
bun add @vite-env/core zod

With any Standard Schema validator

If you prefer Valibot, ArkType, or another Standard Schema-compliant validator, install it instead of Zod:

sh
pnpm add @vite-env/core valibot
sh
npm install @vite-env/core valibot
sh
yarn add @vite-env/core valibot
sh
bun add @vite-env/core valibot

CLI (Optional)

The @vite-env/cli package provides the vite-env command for type generation and validation checks outside of the Vite build process. Install it as a dev dependency:

sh
pnpm add -D @vite-env/cli
sh
npm install -D @vite-env/cli
sh
yarn add -D @vite-env/cli
sh
bun add -D @vite-env/cli

Requirements

RequirementVersion
Node.js>= 20.19.0
Vite>= 8.0.0
Zod>= 4.0.0 (optional — only for defineEnv())

When using defineStandardEnv(), install your preferred Standard Schema-compliant validator (Valibot, ArkType, etc.) instead of Zod. Any version that implements the Standard Schema spec works.

Released under the MIT License.

⚠️ You're reading unreleased (next) docs. Latest stable: v0.5.0 →