favicon-hash-webpack-plugin
This is an extension plugin for html-webpack-plugin - it can add hash to favicon file, just like favicon.[hash].ico
, the hash algorithm is md5 now, and use blueimp-md5 to calculate hash.
Installation
Notice
- it requires node v8 or higher
- it requires webpack >=v4.0.0 and html-webpack-plugin >=3.0.0
- if you want to use this plugin in webpack v3, please check v1 branch
Install
You can install this plugin with npm:
npm install favicon-hash-webpack-plugin --save-dev
or you can use yarn:
yarn add favicon-hash-webpack-plugin -D
Usage
First, require the plugin in your webpack config:
const FaviconHashPlugin = ;
finally, set favicon in html-webpack-plugin
and add the plugin in plugins
options after html-webpack-plugin
...plugins: favicon: 'path-to-favicon/favicon.ico' // favicon path {}...
and the following icon link will be injected into <head>
:
Options
This plugin only has the default options now.