{"id":22023,"library":"rollup-plugin-favicons","title":"rollup-plugin-favicons","description":"A Rollup plugin for generating favicons and associated files from a source image, using the favicons generator. Version 0.5.0 is the latest stable release. It supports caching, custom output via callback, and integrates with rollup-plugin-html2 for automatic injection of link tags. Compared to other solutions, it leverages Rollup's asset emission and is designed for modern build pipelines. Peer dependencies: rollup >=1.25 and rollup-plugin-html2 >=0.7.","status":"active","version":"0.5.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/mentaljam/rollup-plugin-favicons","tags":["javascript","rollup","plugin","favicons"],"install":[{"cmd":"npm install rollup-plugin-favicons","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-favicons","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-favicons","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: Rollup plugin interface","package":"rollup","optional":false},{"reason":"Optional peer dependency for HTML integration","package":"rollup-plugin-html2","optional":true}],"imports":[{"note":"ESM default export. CommonJS require will not work with default export without using .default.","wrong":"const favicons = require('rollup-plugin-favicons')","symbol":"favicons","correct":"import favicons from 'rollup-plugin-favicons'"},{"note":"The package exports a single default function; named import will result in undefined.","wrong":"import { favicons } from 'rollup-plugin-favicons'","symbol":"favicons","correct":"import favicons from 'rollup-plugin-favicons'"},{"note":"TypeScript users can import the type for type-checking if they use the TypeScript declarations.","wrong":"","symbol":"RollupPluginFavicons","correct":"import type { RollupPluginFavicons } from 'rollup-plugin-favicons'"}],"quickstart":{"code":"// rollup.config.js\nimport favicons from 'rollup-plugin-favicons'\nimport html2 from 'rollup-plugin-html2'\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    dir: 'dist',\n    format: 'es',\n  },\n  plugins: [\n    favicons({\n      source: 'src/icon.svg',\n      configuration: {\n        appName: 'My App',\n        appShortName: 'App',\n        background: '#ffffff',\n        theme_color: '#000000',\n        display: 'standalone',\n        orientation: 'any',\n        start_url: '/',\n        scope: '/',\n      },\n      cache: true,\n    }),\n    html2({\n      template: 'src/index.html',\n    }),\n  ],\n}","lang":"javascript","description":"Shows basic usage of rollup-plugin-favicons with rollup-plugin-html2, generating favicons from a source SVG with custom configuration and caching."},"warnings":[{"fix":"Rename appDescription to description in the configuration object passed to the plugin.","message":"Option 'appDescription' is deprecated in favicons configuration; use 'description' instead.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Ensure favicons plugin is listed before html2 in the plugins array.","message":"Plugin order matters: favicons must be placed before rollup-plugin-html2 in the plugins array.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Update usage: remove extra function call (e.g., favicons() becomes favicons).","message":"In version 0.4.0, the default export changed from a factory function to a direct invocation. Previously you had to call favicons() to get the plugin; now it's the plugin itself.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Set an output.dir in your Rollup configuration (e.g., output: { dir: 'dist' }).","message":"If no output.dir is set in Rollup config, rollup-plugin-favicons may emit assets to the current working directory.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install -D rollup-plugin-html2","cause":"Missing peer dependency rollup-plugin-html2 when using it in the plugin list.","error":"Error: Cannot find module 'rollup-plugin-html2'"},{"fix":"Change to 'import favicons from 'rollup-plugin-favicons''","cause":"Using a named import (import { favicons } from ...) instead of default import; the module exports a single default function.","error":"TypeError: favicons is not a function"},{"fix":"Provide a correct absolute or relative path to the source image. Use path.resolve(__dirname, 'src/icon.svg') if needed.","cause":"The source option path is incorrect or the file does not exist.","error":"Error: Could not resolve source image: 'icon.svg'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}