
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
vite-convert-images
Advanced tools
A Vite plugin to convert images to modern formats and create different conversions
A Vite plugin that automatically converts your raster images into modern formats and responsive variants — with zero hassle.
Added 3 image and 2 more 1 seconds later
If you include high-density assets like image@2x.png or image@3x.jpg, the plugin will:
@3x → @2x → @1x, @2x → @1x, depending on max scale).WebP and AVIF formats.Creates a tiny blurred webp thumbnail perfect for lazy-loading or progressive image effects.
Handles multiple images in parallel for maximum performance.
Install, enable, and enjoy optimized images instantly.
npm install vite-convert-images --save-dev
// vite.config.ts
import { defineConfig } from 'vite'
import viteConvertImages from 'vite-convert-images'
export default defineConfig({
plugins: [
viteConvertImages()
]
})
If you save your image in assets folder it will generate all the conversions
❗️Importnat Note
Images name must be end with @2x, @3x, @4x etc. because the conversions count depends on this number.
For example
| Input File | Generated Assets |
|---|---|
hero@3x.png | hero@3x.webp, hero@3x.avif, hero@2x.*, hero@1x.*, hero@lqip.web |
icon@2x.png | icon@2x.webp, icon@2x.avif, icon@1x.*, icon@lqip.webp |
assetsDirAssets directory path
string"/src/assets"formatsImage formats to convert to
ImageFormat[]['avif', 'webp']formatOptionsOptions for each format. This plugin using Sharp behind the scene. Check the documentation for more detail about the different output options.
avif
AvifOptions{
quality: 70,
effort: 4,
chromaSubsampling: '4:2:0'
}
webp
WebpOptions{
quality: 90,
effort: 4,
smartSubsample: true,
nearLossless: false,
}
jpg
JpegOptionsSharp defaultpng
PngOptionsSharp defaultremovableExtensionsRemove files with these extensions when the conversion finishes
ImageFormat[][]batchSizeNumber of concurrent image processing tasks
number4enableScaledVariantsGenerate scaled variants based on the highest-resolution image
booleantrueenableLogsLog generated files to the console
booleanfalsevite-convert-images uses Vite’s watchChange
hook to detect when image files are added, modified or removed.
This means:
🧩 Image conversion runs only while the Vite dev server is active.
⚡ It processes new or updated images on the fly — no need to restart the server.
This approach ensures that the plugin:
Doesn’t slow down your production builds
Keeps development feedback loops instant and responsive
Provides a live, automatic image pipeline while you work
Modern web performance starts with images. vite-convert-images helps you ship smaller, smarter, and future-proof image assets without any manual work.
MIT License © 2025 feat.
FAQs
A Vite plugin to convert images to modern formats and create different conversions
We found that vite-convert-images demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.