A Vite plugin that generates favicons and PWA manifest icons from a single logo image using the favicons library. Current stable version is 1.1.5. It is a fork of the original vite-plugin-favicon that fixes issues with dev mode support, adds ability to generate webapp.html file, and re-enables outputPath configuration. The plugin is applied only during build phase to speed up dev server cold starts. It is compatible with favicons-webpack-plugin configuration.
npm install vite-plugin-favicon2Verified import paths — ran on the pinned version, not inferred.
Shows how to configure the plugin with a custom logo, enabling injection and setting output path.
Use inject: true to automatically inject tags; if you need dev mode support, consider using a different plugin or downgrading to older versions.
Remove these options from your config; they are automatically handled by Vite.
Set inject: true for automatic injection, or manually reference the generated webapp.html in your HTML.
Specify an absolute or relative path to your logo file explicitly.
Run 'npm install --save-dev vite-plugin-favicon2'
Use 'import { ViteFaviconsPlugin } from 'vite-plugin-favicon2' or const { ViteFaviconsPlugin } = require('vite-plugin-favicon2')Use inject: true and accept that favicons won't update in dev; or use a workaround like separate dev build.