Rollup plugin that copies image files to the output directory and returns a require()-compatible path, instead of inlining base64. This fork (v1.0.2) builds on the original with additional features. It targets bundling libraries for React Native and similar environments where base64 inlining is undesirable. Version 1.0.2 is the current stable release, but development appears sparse (no recent commits). Key differentiator from rollup-plugin-image: writes files to disk rather than embedding them as base64.
npm install rollup-plugin-image-fileVerified import paths — ran on the pinned version, not inferred.
Shows basic setup: import the plugin, add to Rollup config, and use an image import in source.
Ensure images are placed in a directory relative to the output, or use a custom copy function.
Use a dedicated plugin for SVG or other formats.
Consider using rollup-plugin-image if base64 inlining is acceptable.
Add the plugin to rollup config and ensure the image exists at the specified path.
Use default import: import images from 'rollup-plugin-image-files'