A Rollup plugin that replaces import paths in bundled output, useful for creating dual CJS/ESM builds by transforming module specifiers (e.g., replacing '/es/' with '/'). Version 1.0.0 is stable but sparsely documented; no known release cadence or major updates. Unlike more complex plugin chains, this focuses on a single transformation function applied after module resolution.
npm install rollup-plugin-replace-importsVerified import paths — ran on the pinned version, not inferred.
Shows basic usage of replaceImports in a Rollup config to transform import paths from '/es/' to '/' for ESM output.
Ensure replacement string exists in at least one import path, or use a callback that logs unmatched paths for debugging.
Place replaceImports inside the output's plugins array, not the top-level plugins.
Install @types/rollup-plugin-replace-imports separately (if available) or declare module manually.
npm install rollup-plugin-replace-imports --save-dev
Change to 'import replaceImports from 'rollup-plugin-replace-imports'' in an ESM context.
Move replaceImports inside output.plugins array.
No dependency data recorded yet.