@filecage/rollup-plugin-image-import-optimize
v0.1.0
Published
This is a [rollup](https://github.com/rollup/rollup) plugin to support importing of images, similar to what [@rollup/plugin-image](https://github.com/rollup/plugins/tree/master/packages/image) does.
Downloads
14
Readme
Rollup Plugin Image Import Optimize
This is a rollup plugin to support importing of images, similar to what @rollup/plugin-image does.
However, this plugin does not import the image into your bundle. Instead, your image is emitted as asset and your import is an object containing URLs to your image in different file formats:
import {webp, png} from './picture.svg';
document.write(`<img src="${webp}" />`);
document.write(`<img src="${png}" />`);
Optimization of images can be configured. The plugin uses sharp internally to process images.