Installation
Core Package
Install @vite-env/core with your preferred schema validator:
With Zod (recommended)
sh
pnpm add @vite-env/core zodsh
npm install @vite-env/core zodsh
yarn add @vite-env/core zodsh
bun add @vite-env/core zodWith 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 valibotsh
npm install @vite-env/core valibotsh
yarn add @vite-env/core valibotsh
bun add @vite-env/core valibotCLI (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/clish
npm install -D @vite-env/clish
yarn add -D @vite-env/clish
bun add -D @vite-env/cliRequirements
| Requirement | Version |
|---|---|
| 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.