Rollup plugin that copies image files to the output directory and replaces imports with require() references. Version 1.4.2, likely low maintenance cadence. Unlike rollup-plugin-image which inlines base64, this preserves binary files, making it suitable for React Native libraries where images must be bundled separately. Limited scope and niche use case.
npm install rollup-plugin-image-filesVerified import paths — ran on the pinned version, not inferred.
Basic Rollup configuration using rollup-plugin-image-files to handle image imports by copying files to output.
Ensure unique image filenames or use a custom naming function (if supported).
Use static import paths for images.
Set output.format to 'cjs' in Rollup config.
Ensure plugin is added to plugins array and images are in a directory relative to the source file.
Use `plugins: [images()]` not `plugins: [images]`.