A Vite plugin that strips code blocks delimited by custom comments from JS/TS/JSX/TSX files during build. Version 1.1.1 is stable with no major releases since initial; inspired by webpack-strip-block. Differentiators: simple comment-based stripping, works out of the box with default markers 'develblock:start'/'develblock:end', supports custom markers, and requires Node >=18.13.0.
npm install vite-plugin-strip-blockVerified import paths — ran on the pinned version, not inferred.
Basic setup of vite-plugin-strip-block in Vite config with default options.
Use Node 18.13.0 or later, or consider using a different version of the plugin if available.
Use conditional code or environment variables if you need to strip in dev as well.
Verify comment format: /* develblock:start */ ... /* develblock:end */
Run 'npm i -D vite-plugin-strip-block' and ensure import is correct.
Use ESM import: import stripBlockPlugin from 'vite-plugin-strip-block'