https://github.com/bootpack/favicons-plugin
Generate favicons with webpack!
https://github.com/bootpack/favicons-plugin
Last synced: 7 months ago
JSON representation
Generate favicons with webpack!
- Host: GitHub
- URL: https://github.com/bootpack/favicons-plugin
- Owner: bootpack
- License: mit
- Created: 2019-06-01T22:04:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-03T19:55:15.000Z (almost 5 years ago)
- Last Synced: 2025-01-27T22:03:40.181Z (over 1 year ago)
- Language: JavaScript
- Size: 1.8 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# favicons-plugin
Generate favicons with webpack!
#  · [](https://GitHub.com/bootpack/favicons-plugin/releases/) [](https://travis-ci.com/bootpack/favicons-plugin) [](https://github.com/bootpack/favicons-plugin/blob/master/LICENSE) [](https://github.com/bootpack/favicons-plugin/blob/master/.github/CONTRIBUTING.md) [](https://GitHub.com/bootpack/favicons-plugin/stargazers/)
Allows to use the [favicons](https://github.com/haydenbleasel/favicons) generator with webpack
Installation
------------
Install the plugin with npm:
```shell
$ npm i -D favicons-plugin
```
Basic Usage
-----------
Add the plugin to your webpack config as follows:
```javascript
let FaviconsPlugin = require('favicons-plugin')
...
plugins: [
new FaviconsPlugin('my-logo.png')
]
```
This basic configuration will generate [37 different icons](https://github.com/bootpack/favicons-plugin/tree/master/test/fixtures/expected/default/icons-366a3768de05f9e78c392fa62b8fbb80) for iOS devices, Android devices and the Desktop browser out of your `my-logo.png` file.
It can optionally also generate a [JSON file with all information about the icons](https://github.com/bootpack/favicons-plugin/blob/master/test/fixtures/expected/generate-html/iconstats.json) for you.
If you are using with [html-webpack-plugin](https://github.com/ampedandwired/html-webpack-plugin) it will also inject the necessary html for you:
https://github.com/bootpack/favicons-plugin/blob/master/test/fixtures/expected/default-with-html/index.html
```html
...
...
```
Advanced Usage
-----------
```javascript
plugins: [
new FaviconsPlugin({
// Your source logo
logo: 'my-logo.png',
// The prefix for all image files (might be a folder or a name)
prefix: 'icons-[hash]/',
// Emit all stats of the generated icons
emitStats: false,
// The name of the json containing all favicon information
statsFilename: 'iconstats-[hash].json',
// Generate a cache file with control hashes and
// don't rebuild the favicons until those hashes change
persistentCache: true,
// Inject the html into the html-webpack-plugin
inject: true,
// favicon background color (see https://github.com/haydenbleasel/favicons#usage)
background: '#fff',
// favicon app title (see https://github.com/haydenbleasel/favicons#usage)
title: 'Webpack App',
// which icons should be generated (see https://github.com/haydenbleasel/favicons#usage)
icons: {
android: true,
appleIcon: true,
appleStartup: true,
coast: false,
favicons: true,
firefox: true,
opengraph: false,
twitter: false,
yandex: false,
windows: false
}
})
]
```
## Contributing
Please contribute using [Gitflow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow). Create a feature branch, add commits, and [open a pull request](https://github.com/bootpack/favicons-plugin/compare/).
## Support
Please [open an issue](https://github.com/bootpack/favicons-plugin/issues/new) for support.
## Special Thanks
This package was forked from [favicons-webpack-plugin (v0.0.9)](https://www.npmjs.com/package/favicons-webpack-plugin). I would like to extend thanks to the original maintainers for creating the package for which this one is based.