A Vite plugin that validates environment variables against a Valibot schema at build time. Current stable version is 1.0.2, released with support for Vite 8 stable. Released under MIT license. Key differentiators: integrates Valibot's modular and lightweight schema validation, supports optional prefix stripping, value transformation (boolean, integer, float, null), localized error messages via @valibot/i18n, and callback hooks for custom issue handling. Requires Node.js 20+ and Valibot 1.0.0+. Alternative to similar plugins using Zod or Joi, offering tree-shakeable validators.
npm install vite-plugin-valibot-envNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Validates environment variables against a Valibot schema, with value transformation and prefix handling.
Update Valibot to 1.0.0 or later; adjust schema syntax if needed (Valibot 1.0 breaking changes).
Use default import: `import valibot from 'vite-plugin-valibot-env'`.
Use `const valibot = require('vite-plugin-valibot-env').default`.Monitor changelog for migration; currently still supported.
Install `@valibot/i18n`, then import it in your vite.config file before using the language option.
Change to `import valibot from 'vite-plugin-valibot-env'`.
Run `npm install vite-plugin-valibot-env valibot` or `deno add jsr:@idleberg/vite-plugin-valibot-env valibot`.
Install `@valibot/i18n` with your package manager.
Upgrade valibot to ^1.0.0 and adjust schema syntax.