ifdef-loader

JSON →
library 2.3.2 ·javascript maintenance
verified May 27, 2026

Webpack loader that adds conditional compilation directives (`#if`, `#elif`, `#else`, `#endif`) inside JavaScript or TypeScript comments, processed at build time. Current stable version is 2.3.2 (last released on npm), with no fixed release cadence; the project appears to be in maintenance mode with infrequent updates. Key differentiators: directives are written inside triple-slash comments so they don't interfere with normal parsing or linters; supports nested conditions, arbitrary JS expressions, and an uncomment-prefix feature to hide syntactically invalid code in comments. Comparable to `preprocessor-loader` or manual environment-based code stripping.

total hits 15
actors 6 distinct systems
last hit 2d ago AhrefsBot
MetaBot
4
GPTBot
2
Script
1
Search engines
1
Humans
2

top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇮 Finland · 🇩🇪 Germany · 🇮🇹 Italy