Vite Environment Code Isolation

JSON →
library 3.0.3 ·javascript
verified May 27, 2026

vite-env-only is a suite of Vite plugins designed to facilitate the isolation of client-side and server-side code within a single codebase. It provides two primary functionalities: `denyImports` to prevent specific modules or files from being bundled into client or server builds, and `envOnlyMacros` (`serverOnly$`, `clientOnly$`) to conditionally include or exclude expressions based on the target environment. The current stable version is 3.0.3, with a release cadence that includes regular patch updates for improved dead code elimination and occasional minor/major releases for new features or architectural changes. A key differentiator from Vite's native `import.meta.env.SSR` is its ability to perform dead-code elimination in development builds, not just production, leading to more accurate environment simulation and smaller bundles during development.

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

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany