A Rollup plugin that strips requirejs-style build pragmas (e.g., //>>includeStart/End) from source code during bundling. Version 1.0.0 is the first stable release with no active development since 2020. Designed primarily for Cesium.js workflows, it provides a simple configuration to specify pragma names to remove. Unlike custom regex solutions, this plugin integrates seamlessly with Rollup's plugin system and handles nested pragmas correctly. Suitable for production builds to eliminate debug-only code blocks.
npm install rollup-plugin-strip-pragmaVerified import paths — ran on the pinned version, not inferred.
Configures Rollup to strip debug pragmas (//>>includeStart/End) from source during bundling.
Ensure your source code uses the exact pragma syntax: //>>includeStart('pragmaName', ...) and //>>includeEnd('pragmaName').Use the same casing as in your source pragmas, e.g., 'debug' vs 'DEBUG'.
If you need complex conditionals, consider using a different plugin or manual transforms.
Run 'npm install rollup-plugin-strip-pragma --save-dev'.
Change import to 'import rollupStripPragma from 'rollup-plugin-strip-pragma'' (no curly braces).
Verify the plugin is installed from npm and imported correctly as default.