Vite plugin that converts SVG (and PNG, JPEG, WebP, AVIF, GIF, TIFF) input into multi-size .ico favicons at build time with HMR support during development. Version 3.1.5 requires Node >=22.18.0 and uses sharp for image processing. Differentiators: multi-format emit (ICO, PNG, SVG) with per-spec injection control, automatic <link> tag deduplication, remote URL support, and a CLI tool for generating favicons standalone.
npm install vite-svg-to-icoNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures vite-svg-to-ico with a multi-format emit array for ICO, PNG, and SVG outputs with HTML injection.
Migrate from { source, sizes, inject } to [{ format, sizes?, filename?, inject? }] as documented in README. The v2 shape still works with deprecation warning but will be removed in v4.Upgrade Node.js to >=22.18.0 or use v2.x of the package (not recommended).
Switch to array-based emit as shown in README.
Check input format when including { format: 'svg' } in emit array; ensure source is actually SVG.If you need to keep custom icon links, avoid inject: true and manually add links.
For development, use local files to get HMR updates on source changes.
npm install -D vite-svg-to-ico
Change to 'import svgToIco from 'vite-svg-to-ico'' in an ESM context (vite.config.ts is ESM by default).
Use default import: import svgToIco from 'vite-svg-to-ico'
npm install sharp (or add it explicitly to dependencies).