A Rollup plugin for content transformation using regex patterns, string replacements, define macros, and custom transforms. Version 1.0.7 is the latest stable release, but the package appears unmaintained since 2018. It allows multiple replace patterns, include/exclude filters, and supports replacing by regex, string, file content, or custom transform function. Differentiates from @rollup/plugin-replace by offering pattern-based and macro-based replacements alongside simple string replacements.
npm install rollup-plugin-reVerified import paths — ran on the pinned version, not inferred.
Basic Rollup setup using rollup-plugin-re for define macros, string replacements, and regex-based replacements.
Migrate to @rollup/plugin-replace for simple string replacements, or use rollup-plugin-string-replace for regex support.
Use 'exclude' instead of 'excludes' in the plugin options object.
Avoid using 'match'; use 'include'/'exclude' for file filtering and 'test'/'replace' for content transformation.
Return only the transformed code string from transform functions.
Use: import replace from 'rollup-plugin-re' (without curly braces).
Run: npm install minimatch --save-dev
Change option name to 'exclude'.