Favigo
raw JSON → 1.1.1 verified Mon Apr 27 auth: no javascript
Universal favicon generator plugin for multiple bundlers including Vite, Webpack, Rollup, esbuild, Rspack, Farm, and Rolldown. Version 1.1.1 is the latest stable release, with active development on GitHub. Generates all favicon formats (ICO, PNG, Apple Touch Icons, Android icons, etc.) from a single source image using Sharp for high-performance image processing. Supports environment-specific visual variants (borders, badges, overlays, tints). Ships with TypeScript definitions and zero-config defaults. Unlike alternatives like 'favicons' CLI, Favigo integrates directly as a build plugin and auto-appends HTML tags.
Common errors
error Error: Cannot find module 'favigo/vite' ↓
cause Missing peer dependency or incorrect import path.
fix
Ensure favigo is installed: npm install --save-dev favigo. Use correct path: 'favigo/vite', not 'favigo'.
error TypeError: favicons is not a function ↓
cause Wrong import style (destructuring default export).
fix
Use default import: import favicons from 'favigo/vite' instead of { favicons }.
error Error: The 'source' option is required ↓
cause Missing required 'source' parameter.
fix
Add source: './path/to/image.png' in the options object.
Warnings
breaking v1.1.0 introduced automatic HTML tag injection into all HTML files. If you manually inject tags, they may duplicate. ↓
fix Set 'skipHtmlInjection: true' in options, or remove manual tag injection.
deprecated The 'output' option was renamed to 'outputPath' in v1.0.0. ↓
fix Use 'outputPath' instead of 'output'.
gotcha Source image must be a valid PNG or SVG file. Other formats may cause Sharp errors. ↓
fix Convert source image to PNG or SVG before using Favigo.
gotcha Plugin is ESM-only (exports ES modules). CommonJS require() only works for Webpack plugin due to Webpack's interop. ↓
fix Use 'import' syntax for Vite, Rollup, esbuild; for Webpack both import and require work.
Install
npm install favigo yarn add favigo pnpm add favigo Imports
- default wrong
import { favicons } from 'favigo/vite'correctimport favicons from 'favigo/vite' - default
const favicons = require('favigo/webpack') - default
import favicons from 'favigo/rollup' - default
import favicons from 'favigo/esbuild'
Quickstart
// Install: npm install --save-dev favigo
// vite.config.ts
import { defineConfig } from 'vite';
import favicons from 'favigo/vite';
export default defineConfig({
plugins: [
favicons({
source: './src/assets/logo.png', // Path to source image
outputPath: 'dist/assets', // Optional output directory
variant: {
type: 'border',
color: '#fbbf24',
width: 8
}
})
]
});
// Run: npx vite build
// Generated favicons will be in dist/assets and HTML tags auto-injected.