{"id":22234,"library":"rollup-plugin-strip-blocks","title":"rollup-plugin-strip-blocks","description":"Rollup plugin that removes blocks of code delimited by special comment tags (/* develblock:start */ and /* develblock:end */ by default) from bundled output. Useful for stripping development-only code such as verbose console warnings, assertions, or debug logs from production builds. Current version 1.0.3 has no updates since release; low maintenance cadence. Differentiators: simple comment-based approach vs AST-based plugins like rollup-plugin-strip-code; no configuration required for basic use.","status":"active","version":"1.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/DavidBindloss/rollup-plugin-strip-blocks","tags":["javascript","rollup","modules","debugging","remove-comments","strip-comments","production-ready","comments"],"install":[{"cmd":"npm install rollup-plugin-strip-blocks","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-strip-blocks","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-strip-blocks","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for plugin functionality","package":"rollup","optional":false}],"imports":[{"note":"ESM-only package; requires import syntax, not CommonJS require.","wrong":"const stripblocks = require('rollup-plugin-strip-blocks')","symbol":"stripblocks","correct":"import stripblocks from 'rollup-plugin-strip-blocks'"},{"note":"Options are passed as an object with start and end strings for custom comment tags.","symbol":"start","correct":"stripblocks({ start: 'DEV-START', end: 'DEV-END' })"},{"note":"Both start and end must be specified together; if only one is provided, the plugin uses the default for the other.","wrong":"stripblocks({ end: 'DEV-END' }) without start","symbol":"end","correct":"stripblocks({ end: 'DEV-END' })"}],"quickstart":{"code":"// rollup.config.js\nimport stripblocks from 'rollup-plugin-strip-blocks';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'es',\n  },\n  plugins: [\n    stripblocks()\n  ]\n};","lang":"javascript","description":"Basic rollup config using the strip-blocks plugin to remove development blocks from the output bundle."},"warnings":[{"fix":"Add a minifier or code removal plugin after strip-blocks.","message":"Plugin does not remove the comment tags themselves; only the code between them is stripped. If you want the comments removed, use an additional plugin like rollup-plugin-terser.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your delimiters are block comments: /* develblock:start */ and /* develblock:end */.","message":"The plugin only works with /* */ multi-line comments as delimiters, not // single-line comments.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using rollup-plugin-strip-code as a more modern alternative.","message":"The plugin uses Rollup's deprecated transform hook internally; may break in future Rollup versions.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Use exactly the default tags or override with custom tags via options.","message":"Default comment tags are case-sensitive: /* develblock:start */, not /* DevelBlock:start */.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run: npm install --save-dev rollup-plugin-strip-blocks","cause":"Package not installed or not resolved as a devDependency.","error":"Error: Cannot find module 'rollup-plugin-strip-blocks'"},{"fix":"Use: import stripblocks from 'rollup-plugin-strip-blocks'","cause":"Incorrect import style; using require() instead of import.","error":"TypeError: stripblocks is not a function"},{"fix":"Ensure blocks are wrapped with /* develblock:start */ and /* develblock:end */ (default). Check for typos.","cause":"Comment tags are not matched (e.g., missing / before *, or wrong case).","error":"The plugin is not stripping my code blocks"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}