Rollup plugin to import image files (PNG, JPG, GIF, SVG) as base64 data URIs or copied files, similar to Webpack's file-loader/url-loader. Current stable version 1.1.0. A single release exists; no updates since 2018. Differentiators: simple configuration, supports hash filenames, custom output path, and file size limit for base64 inlining. Alternative to rollup-plugin-image or rollup-plugin-url.
npm install rollup-plugin-imgNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure rollup-plugin-img with options for output directory, size limit, and hash filenames.
Always specify `output` option to control where copied files land.
Use a more robust plugin like rollup-plugin-url or rollup-plugin-file for production.
If using custom extensions, include SVG if needed: /.(png|jpg|jpeg|gif|svg)$/
Use rollup-plugin-copy or the official Rollup asset mechanism for copying files.
Consider migrating to rollup-plugin-url (for base64) or @rollup/plugin-image for better maintenance.
Upgrade to Rollup 2.x with compatible plugin; or use rollup-plugin-url which supports modern API.
Use `import image from 'rollup-plugin-img'` (no curly braces).
Ensure `image()` plugin is included in the plugins array and image extensions are covered.