esbuild-ifdef

JSON →
library 0.2.0 ·javascript
verified May 1, 2026

An esbuild plugin for compile-time conditional code inclusion/exclusion using `/// #if` comments. Current stable version: 0.2.0. Actively maintained, with a small feature set focused on preprocessor-like behavior. Key differentiators: uses triple-slash comments familiar from C/C++ preprocessors, supports nested conditionals, warnings/errors at compile time, and custom variable injection. Unlike alternatives that rely on other bundlers or complex setups, esbuild-ifdef integrates natively with esbuild and supports any JavaScript expression.

total hits 7
actors 2 distinct systems
last hit 4d ago AhrefsBot
GPTBot
2
Humans
2

top countries 🇬🇧 United Kingdom · 🇨🇦 Canada · 🇺🇸 United States · ZA