JSCC plugin for esbuild that enables conditional compilation using JSCC directives (e.g., //#if, //#ifdef, //#endif) in JavaScript and TypeScript bundles. Version 1.1.2, actively maintained. Integrates seamlessly with esbuild's build pipeline, allowing you to include or exclude code blocks at build time based on predefined or environment variables. Useful for toggling debug code, feature flags, or platform-specific snippets without runtime overhead. Unlike alternatives like preprocessor or esbuild-plugin-condition, it leverages JSCC syntax familiar to developers using JSCC with other bundlers.
npm install esbuild-plugin-jsccNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up esbuild with the JSCC plugin to conditionally include debug code when DEBUG is true.
Ensure all entry points are included in the build and not marked as external if you need JSCC processing.
Update import from 'const jscc = require("esbuild-plugin-jscc")' to 'import jscc from "esbuild-plugin-jscc"'.Use default import: import jscc from 'esbuild-plugin-jscc'
Run npm install esbuild-plugin-jscc --save-dev