vite-plugin-conditional-compile

JSON →
library 1.4.5 ·javascript
verified Apr 27, 2026

A Vite plugin that implements conditional compilation using preprocessor-like directives (#if, #elif, #else, #endif), similar to C/C++ #ifdef. It allows selective inclusion/exclusion of code blocks based on environment variables, custom variables, and logical expressions. Current stable version is 1.4.5, released on an irregular cadence. Key differentiators: supports JSX, Vue templates, and arbitrary file types; integrates with Vite's loadEnv; enables flexible condition syntax with logical operators and nested expressions. Requires Vite ^4.5.0 as a peer dependency. Ships TypeScript types.

total hits 11
actors 3 distinct systems
last hit 6d ago human
GPTBot
5
Search engines
1
Humans
2

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