Vite Environment Code Isolation
JSON →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.
Traffic · last 30 days ↓12% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany