Rollup plugin that renames file paths before they are emitted, rewriting all imports and exports across the bundle to match the new names. Current version is 1.0.1, with a simple API: a map function transforms original file paths to new ones. Unlike other rename plugins, it supports include/exclude patterns and source map generation. Particularly useful when using preserveModules to restructure output directories. No ongoing maintenance activity observed since 2021.
npm install rollup-plugin-renameVerified import paths — ran on the pinned version, not inferred.
Rename source paths from src/ to dist/ when using preserveModules, with source maps and TypeScript types.
Manually rename entry file in output options or use additional plugin.
Ensure the map function handles all possible paths; use include to limit scope.
Use import from '@betit/rollup-plugin-rename'; check package.json of your rollup config.
Use dedicated extension-rename plugin or handle extension logic in build script.
Test with simple file types; open an issue for unsupported cases.
npm install @betit/rollup-plugin-rename --save-dev && use import rename from '@betit/rollup-plugin-rename';
import rename from '@betit/rollup-plugin-rename';
Ensure you are importing the default export from '@betit/rollup-plugin-rename'.