Webpack 5 plugin that generates device- and browser-specific favicons from a source image using the itgalaxy/favicons module. Integrates with HtmlWebpackPlugin and CopyWebpackPlugin to inject <link> tags into HTML files. Current version 1.5.47, requires Node >=18.17.0, ESM-only since v1.3.0. Actively maintained with monthly releases. Key differentiator: native webpack 5 hooks, supports relative path customization via pattern options.
npm install webpack-faviconsVerified import paths — ran on the pinned version, not inferred.
Basic Webpack configuration using webpack-favicons with HtmlWebpackPlugin to generate and inject favicon links.
Upgrade Node.js to version 18.17.0 or higher.
Ensure your project supports ESM (set type: module in package.json) or use an older version (<=1.2.5) of webpack-favicons.
Use Webpack 5 or migrate to https://github.com/jantimon/favicons-webpack-plugin for Webpack 4.
Avoid using the 'callback' option; rely on Webpack hooks instead.
Order plugins: [new HtmlWebpackPlugin(), new WebpackFavicons({...})]Run npm install --save-dev favicons.
Use 'new WebpackFavicons({...})' in the plugins array.Change import to: const WebpackFavicons = require('webpack-favicons');