0.1.0 • Published 2 years ago

@filecage/rollup-plugin-image-import-optimize v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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.

0.1.0

2 years ago