vite-plugin-html-env

JSON →
library 1.2.8 ·javascript
verified Apr 27, 2026

A Vite plugin for rewriting HTML templates with environment variables and conditional directives. Current stable version is 1.2.8, maintained on npm. It allows replacing placeholders in HTML files with values from .env files, supports customizable prefix/suffix (default <{ }>), and offers a compiler mode with vite-if/vite-else directives. Compiler mode is enabled by default since v1.0.4, which was a breaking change from older versions. Differentiates from similar plugins by supporting import.meta.env syntax in HTML and optionally compressing output. Ships TypeScript type definitions. Minimal peer dependency on Vite.

total hits 13
actors 4 distinct systems
last hit 6d ago human
GPTBot
5
MetaBot
3
Search engines
1
Humans
1

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇲🇽 Mexico