vite-plugin-vsharp

A Vite plugin that compresses static images after each builds by using sharp.js

vite-plugin-image-compress

You can add it as a dev dependency to any of the package managers (NPM, Yarn, PNPM)