vite-plugin-conditional-compiler

JSON →
library 0.4.0 ·javascript
verified Apr 27, 2026

A Vite plugin for conditional compilation using comments based on environment variables. Current stable version is 0.4.0. It allows developers to include or exclude code blocks at build time by wrapping them in `#v-ifdef`, `#v-elif`, `#v-else`, and `#v-endif` directives that reference Vite environment variables (e.g., `PROD`, `DEV`, custom env vars). Supports logical OR, custom values, and `!=` comparisons. Since v0.2.0, it wraps `unplugin-preprocessor-directives`. Release cadence is moderate with occasional bug fixes and feature releases. Key differentiator: lightweight, no runtime overhead, and works in any file type (JS, CSS, HTML) via comments.

total hits 11
actors 3 distinct systems
last hit 21h ago AhrefsBot
GPTBot
5
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · AR