rollup-plugin-image-files
Like rollup-plugin-image, but writes image files to dest instead of inlining base64. This was written for a library that would be consumed by react-native applications.
Usage
Install the plugin via npm:
npm install --save-dev rollup-plugin-image-files
Add the plugin to your rollup config:
; entry: 'src/index.js' des: 'dist/bundle.js' plugins:
Require some images in your source:
;;; const MyComponent = <Image source=imageSrc/>;
What it does
The plugin does two things:
- Copies the source image into the same directory as the destination file.
- Replaces the image required with a module that exports the result of calling require on the copied image.