An esbuild plugin for conditional compilation using `//#if`, `//#else`, and `//#endif` directives in JavaScript/TypeScript files. Version 1.0.2, released as first stable. Requires esbuild and ESM setup (`type: module` in package.json and `.mjs` extensions). Differentiates from other conditional build tools by being lightweight and esbuild-native, using simple comment-based directives.
npm install esbuild-plugin-conditional-buildNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up esbuild with conditional build plugin, defining 'DEVELOPMENT' constant and building entry point.
Add "type": "module" to package.json and rename files to .mjs.
Add //#conditional as the first line of your source files.
Ensure all files with conditional comments are included in esbuild build.
Add "type": "module" to package.json and use .mjs extension for your build script.
Add //#conditional as first line of the file.