Gathering detailed insights and metrics for @anolilab/unplugin-favicons
Gathering detailed insights and metrics for @anolilab/unplugin-favicons
Gathering detailed insights and metrics for @anolilab/unplugin-favicons
Gathering detailed insights and metrics for @anolilab/unplugin-favicons
Generate favicons for your project with caching for blazing fast rebuilds.
npm install @anolilab/unplugin-favicons
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (89.43%)
JavaScript (6.4%)
Shell (4.17%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
8 Stars
85 Commits
2 Forks
2 Watchers
14 Branches
2 Contributors
Updated on Jun 22, 2025
Latest Version
1.0.5
Package Id
@anolilab/unplugin-favicons@1.0.5
Unpacked Size
80.77 kB
Size
20.00 kB
File Count
26
NPM Version
9.6.7
Node Version
20.17.0
Published on
Sep 04, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
9
8
63
Create and manage favicons with Vite, Rollup, Webpack, Rspack, Nuxt, Vue CLI, Svelte, esbuild and Astro on top of itgalaxy/favicons
Daniel Bannert's open source work is supported by the community on GitHub Sponsors
1npm install --dev-save @anolilab/unplugin-favicons favicons
1yarn add -D @anolilab/unplugin-favicons favicons
1pnpm add -D @anolilab/unplugin-favicons favicons
Add your base logo as logo.png
file to your assets folder.
1unpluginFavicons({
2 /**
3 * Specify each icon type to render. Unlike `favicons`, this plugin is
4 * opt-in, meaning only the icon types you declare here will be rendered.
5 *
6 * For each icon type, all `favicons` options are supported. An
7 * additional `source` property is required to indicate the asset to be
8 * used for that icon type.
9 */
10 icons: {
11 favicons: {
12 source: "./assets/favicon.png",
13 },
14 android: {
15 source: "./assets/android.png",
16 },
17 appleStartup: {
18 source: "./assets/apple-startup.png",
19 },
20 },
21});
1// vite.config.ts 2import unpluginFavicons from "@anolilab/unplugin-favicons/vite"; 3 4export default defineConfig({ 5 plugins: [ 6 unpluginFavicons({ 7 /* options */ 8 }), 9 ], 10});
1// rollup.config.js 2import unpluginFavicons from "@anolilab/unplugin-favicons/rollup"; 3// To use the auto inject 4import html from "@rollup/plugin-html"; 5 6export default { 7 plugins: [ 8 // html(), // optional 9 unpluginFavicons({ 10 /* options */ 11 }), 12 ], 13};
1// esbuild.config.js 2import { build } from "esbuild"; 3 4build({ 5 plugins: [ 6 require("@anolilab/unplugin-favicons/esbuild")({ 7 /* options */ 8 }), 9 ], 10});
1// webpack.config.js 2module.exports = { 3 /* ... */ 4 plugins: [ 5 require("@anolilab/unplugin-favicons/webpack")({ 6 /* options */ 7 }), 8 ], 9};
1// vue.config.js 2module.exports = { 3 configureWebpack: { 4 plugins: [ 5 require("@anolilab/unplugin-favicons/webpack")({ 6 /* options */ 7 }), 8 ], 9 }, 10};
Nuxt 2 and Nuxt Bridge
1// nuxt.config.js 2export default { 3 buildModules: [ 4 [ 5 "@anolilab/unplugin-favicons/nuxt", 6 { 7 /* options */ 8 }, 9 ], 10 ], 11};
Nuxt 3
1// nuxt.config.js 2export default defineNuxtConfig({ 3 modules: [ 4 [ 5 "@anolilab/unplugin-favicons/nuxt", 6 { 7 /* options */ 8 }, 9 ], 10 ], 11});
See the Nuxt example for a working example project.
The @anolilab/unplugin-favicons
plugin should be configured in the vite.config.js
configuration file:
1// vite.config.js 2import { defineConfig } from "vite"; 3import { sveltekit } from "@sveltejs/kit/vite"; 4import unpluginFavicons from "@anolilab/unplugin-favicons/vite"; 5 6export default defineConfig({ 7 plugins: [ 8 sveltekit(), 9 unpluginFavicons({ 10 /* options */ 11 }), 12 ], 13});
Check instructions in the Frameworks -> Svelte
section below if you faced module import errors.
See the SvelteKit example for a working example project.
Svelte support requires the @sveltejs/vite-plugin-svelte
plugin:
1npm i -D @sveltejs/vite-plugin-svelte
The @anolilab/unplugin-favicons
plugin should be configured in the vite.config.js
configuration file:
1// vite.config.js 2import { defineConfig } from "vite"; 3import { svelte } from "@sveltejs/vite-plugin-svelte"; 4import unpluginFavicons from "@anolilab/unplugin-favicons/vite"; 5 6export default defineConfig({ 7 plugins: [ 8 svelte(), 9 unpluginFavicons({ 10 /* options */ 11 }), 12 ], 13});
Check instructions in the Frameworks -> Svelte
section below if you faced module import errors.
See the Svelte + Vite example for a working example project.
The @anolilab/unplugin-favicons
plugin should be configured on next.config.js
configuration file:
1/** @type {import('next').NextConfig} */ 2module.exports = { 3 reactStrictMode: true, 4 webpack(config) { 5 config.plugins.push( 6 require("@anolilab/unplugin-favicons/webpack")({ 7 /* options */ 8 }), 9 ); 10 11 return config; 12 }, 13};
Check instructions in the Frameworks -> React
section below if you faced module import errors.
See the Next.js example for a working example project.
1// astro.config.mjs 2import { defineConfig } from "astro/config"; 3import unpluginFavicons from "@anolilab/unplugin-favicons/vite"; 4 5// https://astro.build/config 6export default defineConfig({ 7 vite: { 8 plugins: [ 9 unpluginFavicons({ 10 /* options */ 11 }), 12 ], 13 }, 14});
See the Astro example for a working example project.
The default configuration will automatically generate webapp manifest files along with 44 different icon formats as appropriate for iOS devices, Android devices, Windows Phone and various desktop browsers out of your single logo.png
.
Tip: You might want to fine tune what vendors to support.
Under the hood, Vite/Rollup resolve the paths to the logo and favicons according to the following rules:
If /path/to/logo
is absolute, there is nothing to resolve and the path
specified is used as is.
If ./path/to/logo
is relative, it’s resolved with respect to process.cwd()
.
In combination with Vite’s html plugin hooks it will also inject the necessary html for you:
1<link rel="apple-touch-icon" sizes="57x57" href="/assets/apple-touch-icon-57x57.png" /> 2<link rel="apple-touch-icon" sizes="60x60" href="/assets/apple-touch-icon-60x60.png" /> 3<link rel="apple-touch-icon" sizes="72x72" href="/assets/apple-touch-icon-72x72.png" /> 4<link rel="apple-touch-icon" sizes="76x76" href="/assets/apple-touch-icon-76x76.png" /> 5<link rel="apple-touch-icon" sizes="114x114" href="/assets/apple-touch-icon-114x114.png" /> 6<link rel="apple-touch-icon" sizes="120x120" href="/assets/apple-touch-icon-120x120.png" /> 7<link rel="apple-touch-icon" sizes="144x144" href="/assets/apple-touch-icon-144x144.png" /> 8<link rel="apple-touch-icon" sizes="152x152" href="/assets/apple-touch-icon-152x152.png" /> 9<link rel="apple-touch-icon" sizes="167x167" href="/assets/apple-touch-icon-167x167.png" /> 10<link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon-180x180.png" /> 11<link rel="apple-touch-icon" sizes="1024x1024" href="/assets/apple-touch-icon-1024x1024.png" /> 12<link 13 rel="apple-touch-startup-image" 14 media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" 15 href="/assets/apple-touch-startup-image-320x460.png" 16/> 17<link 18 rel="apple-touch-startup-image" 19 media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" 20 href="/assets/apple-touch-startup-image-640x920.png" 21/> 22<link 23 rel="apple-touch-startup-image" 24 media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" 25 href="/assets/apple-touch-startup-image-640x1096.png" 26/> 27<link 28 rel="apple-touch-startup-image" 29 media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" 30 href="/assets/apple-touch-startup-image-750x1294.png" 31/> 32<link 33 rel="apple-touch-startup-image" 34 media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" 35 href="/assets/apple-touch-startup-image-1182x2208.png" 36/> 37<link 38 rel="apple-touch-startup-image" 39 media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" 40 href="/assets/apple-touch-startup-image-1242x2148.png" 41/> 42<link 43 rel="apple-touch-startup-image" 44 media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" 45 href="/assets/apple-touch-startup-image-748x1024.png" 46/> 47<link 48 rel="apple-touch-startup-image" 49 media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" 50 href="/assets/apple-touch-startup-image-1496x2048.png" 51/> 52<link 53 rel="apple-touch-startup-image" 54 media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" 55 href="/assets/apple-touch-startup-image-768x1004.png" 56/> 57<link 58 rel="apple-touch-startup-image" 59 media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" 60 href="/assets/apple-touch-startup-image-1536x2008.png" 61/> 62<link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png" /> 63<link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png" /> 64<link rel="icon" type="image/png" sizes="228x228" href="/assets/coast-228x228.png" /> 65<link rel="manifest" href="/assets/manifest.json" /> 66<link rel="shortcut icon" href="/assets/favicon.ico" /> 67<link rel="yandex-tableau-widget" href="/assets/yandex-browser-manifest.json" /> 68<meta name="apple-mobile-web-app-capable" content="yes" /> 69<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /> 70<meta name="apple-mobile-web-app-title" /> 71<meta name="application-name" /> 72<meta name="mobile-web-app-capable" content="yes" /> 73<meta name="msapplication-TileColor" content="#fff" /> 74<meta name="msapplication-TileImage" content="/assets/mstile-144x144.png" /> 75<meta name="msapplication-config" content="/assets/browserconfig.xml" /> 76<meta name="theme-color" content="#fff" />
1 unpluginFavicons({ 2 /** Your source logo (Will default to ) */ 3 logo?: "assets/logo.png", 4 /** Inject html links/metadata. */ 5 inject?: true, 6 /** `Favicons` configuration options 7 * - [See `favicons` documentation](https://github.com/itgalaxy/favicons) */ 8 favicons?: FaviconsConfig, 9 /** The root of the project from which you want to load metadata */ 10 projectRoot?: process.cwd(), 11 })
To fine tune what icons/metadata is generated, refer to favicons’ documentation.
The options specified under favicons:
are handed over as is to [favicons],
except that if appName
, appDescription
, version
, developerName
or
developerURL
are left undefined
, they will be automatically inferred
respectively from name
, description
, version
, author.name
and
author.url
as defined in the nearest package.json
if available.
And if there’s no author
it will use the first in the contributors
.
To disable automatically retrieving metadata from package.json
, set
to null
the properties you want to omit.
1unpluginFavicons({ 2 logo: "./src/logo.png", // svg works too! 3 favicons: { 4 appName: "my-app", 5 appDescription: "My awesome App", 6 developerName: "Me", 7 developerURL: null, // prevent retrieving from the nearest package.json 8 background: "#ddd", 9 theme_color: "#333", 10 icons: { 11 coast: false, 12 yandex: false, 13 }, 14 }, 15});
To fine tune what icons/metadata is generated, refer to favicons’ documentation.
Vite calls the HTML transform hook for each HTML file template file you have configured in Vite, so this works automatically.
Take a look at the CHANGELOG.md.
You’re free to contribute to this project by submitting issues and/or pull requests.
Please keep in mind that every change and feature should be covered by tests.
This project is licensed under MIT.
Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.
If you would like to help take a look at the list of issues and check our Contributing guild.
Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
The anolilab vite-plugin-favicon is open-sourced software licensed under the MIT license
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
12 out of 12 merged PRs checked by a CI test -- score normalized to 10
Reason
project has 4 contributing companies or organizations
Details
Reason
no dangerous workflow patterns detected
Reason
update tool detected
Details
Reason
security policy file detected
Details
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 8
Details
Reason
SAST tool detected but not run on all commits
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
Found 0/4 approved changesets -- score normalized to 0
Reason
project is not fuzzed
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
32 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-08T07:29:17Z
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More