vite-plugin-lqip
Version:
Low-quality image placeholder (LQIP) plugin for Vite.
20 lines (19 loc) • 608 B
TypeScript
import sharp from 'sharp';
import type { Plugin } from 'vite';
export interface LQIPPluginOptions {
sharp?: {
/**
* (optional) Provide options to sharp.resize
* @default { width: 32, height: 32, fit: 'inside', kernel: sharp.kernel.cubic }
*/
resize?: sharp.ResizeOptions;
/** (optional) provide options to sharp.webp */
webp?: sharp.WebpOptions;
/**
* (optional) provide blur factor
* @default 1.5
*/
blur?: number;
};
}
export default function vitePluginLqip(options?: LQIPPluginOptions): Plugin;