npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vite-plugin-image-optimize

v2.0.1

Published

Vite plugin that generates AVIF and WebP images and optimizes all image assets during the build process for better performance.

Downloads

101

Readme

EN | FR

BrowserUX Image Optimize

vite-plugin-image-optimize is a Vite plugin that automatically generates .avif and .webp versions of your images and optimizes all your JPG, PNG, SVG, WebP, and AVIF files during production builds.

npm version vite compatibility

Features

  • 🖼️ Generates .avif and .webp from .jpg/.png in /public/img
  • 🚀 Optimizes images in /dist/img (JPG, PNG, SVG, WebP, AVIF)
  • ⚡ Parallel processing with Promise.all for fast builds
  • 🔁 Skips pre-build generation when output is already up to date
  • 🔍 Supports glob-based file exclusion
  • 🔧 Configurable quality settings per format
  • 📦 Optionally logs detailed per-file compression stats
  • 🛠️ Powered by sharp and svgo

Installation

npm install vite-plugin-image-optimize --save-dev

Usage

import { defineConfig } from 'vite'
import imageOptimize from 'vite-plugin-image-optimize'

export default defineConfig({
  plugins: [
    imageOptimize({
      jpegQuality: 80,
      pngQuality: 80,
      webpQuality: 75,
      avifQuality: 50,
      webpEnable: true,
      avifEnable: true,
      exclude: [],
      logListings: true
    })
  ]
})

Options

| Option | Type | Default | Description | | --- | --- | --- | --- | | jpegQuality | number | 80 | JPEG compression quality (0-100) | | pngQuality | number | 80 | PNG compression quality (0-100) | | webpQuality | number | 75 | WebP conversion/compression quality (0-100) | | avifQuality | number | 50 | AVIF conversion/compression quality (0-100) | | webpEnable | boolean | true | Enable WebP generation during pre-build | | avifEnable | boolean | true | Enable AVIF generation during pre-build | | exclude | string[] | [] | Glob patterns to exclude from all processing | | logListings | boolean | true | Enable detailed per-file logging in the terminal |

Migrating from v1

| v1 option | v2 equivalent | Notes | | --- | --- | --- | | pngQuality | pngQuality | Type changed: [number, number]number (0-100) | | webpFormats | (removed) | Plugin always targets .jpg/.jpeg/.png | | webpExclude | exclude | Now applies to all processing phases |

Documentation

For detailed documentation, see docs/index.md.

License

MIT © 2025 Effeilo