rollup-plugin-ifdef
JSON →A conditional compilation plugin for Rollup and Vite, allowing you to include or exclude code blocks based on build-time flags or environment variables. Supports JavaScript, TypeScript, CSS, SCSS, Vue, and React files. v1.1.1 is the current stable version, released in 2023 and last updated in 2023. It uses a comment-based syntax (e.g., @ifdef and @ifndef) similar to C preprocessor directives, making it easy to toggle debug code, platform-specific features, or feature flags without modifying the source. Unlike alternatives that rely on environment variable replacement or dead-code elimination, this plugin performs actual code removal at build time, ensuring zero runtime overhead.
Traffic · last 30 days ↑50% vs prev 7d
total hits 12
actors 4 distinct systems
last hit 5d ago Bingbot
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France
Resources
API endpoints
full doc /v1/registry/rollup-plugin-ifdef