{"id":17150946,"url":"https://github.com/drolsen/webpack-favicons","last_synced_at":"2026-03-05T17:19:09.460Z","repository":{"id":44687970,"uuid":"325521147","full_name":"drolsen/webpack-favicons","owner":"drolsen","description":"Plugin to generate favicons for browsers and devices","archived":false,"fork":false,"pushed_at":"2024-10-24T07:54:38.000Z","size":561,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T03:04:32.643Z","etag":null,"topics":["favicon","favicons","webpack","webpack-favicon","webpack-favicons","webpack5"],"latest_commit_sha":null,"homepage":"https://github.com/drolsen/webpack-favicons","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drolsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-30T10:29:13.000Z","updated_at":"2025-02-22T10:52:12.000Z","dependencies_parsed_at":"2024-06-18T22:38:47.368Z","dependency_job_id":"08389642-75bd-42f6-a8a1-ddcb2aa29f80","html_url":"https://github.com/drolsen/webpack-favicons","commit_stats":{"total_commits":34,"total_committers":2,"mean_commits":17.0,"dds":"0.38235294117647056","last_synced_commit":"f1d12eb313e03fb309f5c18498dd0178e99da0ca"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drolsen%2Fwebpack-favicons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drolsen%2Fwebpack-favicons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drolsen%2Fwebpack-favicons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drolsen%2Fwebpack-favicons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drolsen","download_url":"https://codeload.github.com/drolsen/webpack-favicons/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710439,"owners_count":21149188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["favicon","favicons","webpack","webpack-favicon","webpack-favicons","webpack5"],"created_at":"2024-10-14T21:36:53.841Z","updated_at":"2026-03-05T17:19:09.412Z","avatar_url":"https://github.com/drolsen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"/assets/logo.png\" width=\"500\" /\u003e\n  \u003cp style=\"margin-top: 25px;\"\u003ePlugin to generate favicons for browsers and devices.\u003c/p\u003e\n\n[![Build Status](https://app.travis-ci.com/drolsen/webpack-favicons.svg?branch=master)](https://app.travis-ci.com/drolsen/webpack-favicons)\n[![Minimum node.js version](https://badgen.net/badge/node/%3E=18.17.0/green)](https://npmjs.com/package/webpack-favicons)\n[![downloads](https://img.shields.io/npm/dm/webpack-favicons.svg?style=flat-square)](http://npm-stat.com/charts.html?package=webpack-favicons\u0026from=2022-01-08)\n[![version](https://img.shields.io/npm/v/webpack-favicons.svg?style=flat-square)](http://npm.im/webpack-favicons)\n[![GitLab release](https://badgen.net/github/releases/drolsen/webpack-favicons)](https://github.com/drolsen/webpack-favicons/releases)\n[![MIT License](https://img.shields.io/npm/l/webpack-favicons.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://github.com/drolsen/webpack-favicons/graphs/commit-activity)\n\u003c/div\u003e\n\n### Does this plugin work with Webpack 4?\nNo, you should checkout https://github.com/jantimon/favicons-webpack-plugin for a Webpack 4 compatible plugin.\n\n\n### How does it works\nBy tapping into the Webpack 5's latest hooks, WebackFavicon digs into a given build to search for any instances of HTML file assets.\nWhile doing that, it leverages the favicon (https://github.com/itgalaxy/favicons) module to generate configured favicons off your provided source file.\n\nOnce done, you will have device or browser specific generated favicons written to disk while HTML files (with a `\u003chead\u003e` tag) will have corresponding `\u003clink\u003e` tags injected.\n\n### Does this work with CopyWebpackPlugin?\nYep! While it is more common to see a Webpack configuration using `HtmlWebpackPlugin` in order to process HTML files; WebpackFavicons will inject `\u003clink\u003e` tags into HTML documents found being copied by `CopyWebpackPlugin` and/or `HtmlWebpackPlugin`.\n\n---\n## Install\n```\nnpm i --save-dev webpack-favicons\n```\nor\n```\nyarn add --dev webpack-favicons\n```\n\n## Webpack Config\n```js\nconst WebpackFavicons = require('webpack-favicons');\n```\nInstantiate a `new WebpackFavicons()` class within Webpack configuration's plugin array:\n\n```js\n\n// Basic configuration\n\nmodule.exports = {\n  output: {\n    path: '/dist', \n    publicPath: '/~media/'\n  }  \n  plugins: [\n    new WebpackFavicons({\n      src: 'assets/favicon.svg',\n      path: 'img',\n      background: '#000',\n      theme_color: '#000',\n      icons: {\n        favicons: true\n      }\n    })\n  ]\n};\n```\n\nWill result in file(s) being written to:\n- /dist/img/favicon.ico\n- /dist/img/favicon16x16.png \n- /dist/img/favicon32x32.png\n- /dist/img/favicon48x48.png\n\nWhile any HTML with a `\u003chead\u003e` tag will have paths to favicons added:\n```html\n\u003clink rel=\"shortcut icon\" href=\"/~media/img/favicon.ico\"\u003e\n\u003clink rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/~media/img/favicon-16x16.png\"\u003e\n\u003clink rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/~media/img/favicon-32x32.png\"\u003e\n\u003clink rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"/~media/img/favicon-48x48.png\"\u003e\n```\n\nIt is recommended that your source favicon file be a SVG vector file to allow best possible quality to generated pixel based favicons from.\n\n---\n\n## Options\n\nNote: These options both come from, and are directly passed to the favicon generating node module.\nFor much more information about these options please visit: https://github.com/itgalaxy/favicons\n\nOption | Type | Description\n--- | --- | ---\n`src` | String | Path to the source favicon file which all favicons will be generated from\n`path` | String | Path to where icons get written (is relative to webpack's `output.path`)\n`appName` | String | Your application's name.\n`appShortName` | String | Your application's short_name. (Optional. If not set, appName will be used)\n`appDescription` | String | Your application's description.\n`developerName` | String | Your (or your developer's) name.\n`developerURL` | String | Your (or your developer's) URL.\n`dir` | String | Primary text direction for name, short_name, and description\n`lang` | String | Primary language for name and short_name\n`background` | String | Background color for flattened icons.\n`theme_color` | String | Theme color user for example in Android's task switcher.\n`appleStatusBarStyle` | String | Style for Apple status bar: \"black-translucent\", \"default\", \"black\".\n`display` | String | Preferred display mode: \"fullscreen\", \"standalone\", \"minimal-ui\" or \"browser\".\n`orientation` | String | Default orientation: \"any\", \"natural\", \"portrait\" or \"landscape\".\n`scope` | String | set of URLs that the browser considers within your app\n`start_url` | String | Start URL when launching the application from a device.\n`version` | String | Your application's version string.\n`logging` | Boolean | Print logs to console?\n`pixel_art` | String | Keeps pixels \"sharp\" when scaling up, for pixel art.  Only supported in offline mode.\n`loadManifestWithCredentials` | Boolean | Browsers don't send cookies when fetching a manifest, enable this to fix that.\n`icons` | Object | See below for more details about this object's options.\n\n---\n\n## Icon Object's Options\n\nOption | Type | Description\n--- | --- | ---\n`android` | Boolean | Create Android homescreen icon. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n`appleIcon` | Boolean | Create Apple touch icons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n`appleStartup` | Boolean | Create Apple startup images. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n`coast` | Boolean | Create Opera Coast icon. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n`favicons` | Boolean | Create regular favicons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n`firefox` | Boolean | Create Firefox OS icons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n`windows` | Boolean | Create Windows 8 tile icons. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n`yandex` | Boolean | Create Yandex browser icon. `boolean` or `{ offset, background, mask, overlayGlow, overlayShadow }` or an array of sources\n\n---\n\n## Callback\n\nOptional callback allowing the opportunity to alter the generated images, html and manifest file(s) data prior to Webpack writing anything to disk:\n\n```js\n\n// Basic configuration\n\nmodule.exports = {\n  output: {\n    path: '/dist', \n    publicPath: '/~media/'\n  }  \n  plugins: [\n    new WebpackFavicons({\n      ...\n    }, (response) =\u003e {\n      // alter generated images, html or manifest file data here\n      response.images[0].name = 'custom.ico';\n      response.html[0] = response.html[0].replace('favicon.ico', 'custom.ico');\n    })\n  ]\n};\n```\n\n---\n\n### Tests\n\nWebpack Favicons comes with a few `test`s.\nThese helps ensure that both favicons get written to disk and that link tags are injected into any HTML assets within the larger Webpack build process.\n\nSimply run `npm run test` or `yarn test` from the root of the plugin to run test.\n\nRunning a test will produce a `/dist/` directory.\n\nIf you would like to change a test, update the root package.json file's `test` script to use any of the `/test/test.config.js` files.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrolsen%2Fwebpack-favicons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrolsen%2Fwebpack-favicons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrolsen%2Fwebpack-favicons/lists"}