Gathering detailed insights and metrics for favicons-webpack-plugin-2
Gathering detailed insights and metrics for favicons-webpack-plugin-2
Gathering detailed insights and metrics for favicons-webpack-plugin-2
Gathering detailed insights and metrics for favicons-webpack-plugin-2
Let webpack generate app manifest, all your favicons and icons for you
npm install favicons-webpack-plugin-2
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
6 Stars
1 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 23, 2020
Latest Version
1.1.0
Package Id
favicons-webpack-plugin-2@1.1.0
Unpacked Size
28.33 kB
Size
9.14 kB
File Count
8
NPM Version
6.9.0
Node Version
9.6.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
1
22
This is fork of jantimon/favicons-webpack-plugin with improvements:
favicons
packageAllows to use the favicons generator with webpack.
This plugin also generates manifest files:
manifest.json
browserconfig.xml
yandex-browser-manifest.json
You must be running webpack (version ^2.x)
on node (version ^6.14.1)
Install:
1npm install --save-dev app-manifest-webpack-plugin
Install with yarn:
1yarn add -D app-manifest-webpack-plugin
Add the plugin to your webpack config as follows:
1const AppManifestWebpackPlugin = require('app-manifest-webpack-plugin') 2 3... 4 5plugins: [ 6 new AppManifestWebpackPlugin({ 7 logo: 'my-logo.png', 8 inject: false, 9 }) 10]
This basic configuration will generate 37 different icons for iOS devices, Android devices and the Desktop browser out of your my-logo.png
file.
It can optionally also generate a iconstats.json
for you.
html-webpack-plugin
If you are using with html-webpack-plugin it will also inject the necessary html for you:
1 <link rel="apple-touch-icon" sizes="57x57" href="icons-366a3768de05f9e78c392fa62b8fbb80/apple-touch-icon-57x57.png"> 2 <link rel="apple-touch-icon" sizes="60x60" href="icons-366a3768de05f9e78c392fa62b8fbb80/apple-touch-icon-60x60.png"> 3 <link rel="apple-touch-icon" sizes="72x72" href="icons-366a3768de05f9e78c392fa62b8fbb80/apple-touch-icon-72x72.png"> 4 ... 5 ... 6 <link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="icons-366a3768de05f9e78c392fa62b8fbb80/apple-touch-startup-image-1536x2008.png">
1plugins: [ 2 new HtmlWebpackPlugin(), 3 // Make sure that AppManifestWebpackPlugin below HtmlWebpackPlugin 4 new AppManifestWebpackPlugin({ 5 logo: 'my-logo.png', 6 statsFilename: 'iconstats.json', 7 persistentCache: false, 8 config: { 9 path: '/static/assets/', 10 }, 11 }), 12]
1plugins: [ 2 new AppManifestWebpackPlugin({ 3 // Your source logo 4 logo: 'my-logo.png', 5 // Prefix for file names 6 prefix: '/assets/icons-[hash:8]/', // default '/' 7 // Output path for icons (icons will be saved to output.path(webpack config) + this key) 8 output: '/icons-[hash:8]/', // default '/'. Can be absolute or relative 9 // Emit all stats of the generated icons 10 emitStats: false, 11 // The name of the json containing all favicon information 12 statsFilename: 'iconstats.json', // can be absolute path 13 // Encode html entities in stats file (Example json_decode from php doesn't support html strings with escaped double quotes but it's valid json) 14 statsEncodeHtml: false, 15 // Generate a cache file with control hashes and 16 // don't rebuild the favicons until those hashes change 17 persistentCache: true, 18 // Inject the html into the html-webpack-plugin. Default true 19 inject: true, 20 // favicons configuration object. Support all keys of favicons (see https://github.com/haydenbleasel/favicons) 21 config: { 22 appName: 'Webpack App', // Your application's name. `string` 23 appDescription: null, // Your application's description. `string` 24 developerName: null, // Your (or your developer's) name. `string` 25 developerURL: null, // Your (or your developer's) URL. `string` 26 background: '#fff', // Background colour for flattened icons. `string` 27 theme_color: '#fff', // Theme color for browser chrome. `string` 28 display: 'standalone', // Android display: "browser" or "standalone". `string` 29 orientation: 'portrait', // Android orientation: "portrait" or "landscape". `string` 30 start_url: '/?homescreen=1', // Android start application's URL. `string` 31 version: '1.0', // Your application's version number. `number` 32 logging: false, // Print logs to console? `boolean` 33 icons: { 34 // Platform Options: 35 // - offset - offset in percentage 36 // - shadow - drop shadow for Android icons, available online only 37 // - background: 38 // * false - use default 39 // * true - force use default, e.g. set background for Android icons 40 // * color - set background for the specified icons 41 // 42 android: true, // Create Android homescreen icon. `boolean` or `{ offset, background, shadow }` 43 appleIcon: true, // Create Apple touch icons. `boolean` or `{ offset, background }` 44 appleStartup: true, // Create Apple startup images. `boolean` or `{ offset, background }` 45 coast: { offset: 25 }, // Create Opera Coast icon with offset 25%. `boolean` or `{ offset, background }` 46 favicons: true, // Create regular favicons. `boolean` 47 firefox: true, // Create Firefox OS icons. `boolean` or `{ offset, background }` 48 windows: true, // Create Windows 8 tile icons. `boolean` or `{ background }` 49 yandex: true, // Create Yandex browser icon. `boolean` or `{ background }` 50 }, 51 } 52 }) 53]
This options help you save output files or change paths to icons in your html as you want.
Example you want save output icons to icons/
directory in your build path but in html you want set another prefix for files, example /assets/webpack/icons/
when you can use options for this
1 new AppManifestWebpackPlugin({ 2 // Your source logo 3 logo: 'my-logo.png', 4 // Prefix for file names (html will be container icons with this prefix) 5 prefix: '/assets/webpack/', 6 // Output path for icons (icons will be saved to output.path(webpack config) + this key) 7 output: '/icons-[hash:8]/' 8 })
html file will be contains current paths
1<link rel="apple-touch-icon" sizes="120x120" href="/assets/webpack/icons-4b62aad7/apple-touch-icon-120x120.png"> 2<link rel="apple-touch-icon" sizes="144x144" href="/assets/webpack/icons-4b62aad7/apple-touch-icon-144x144.png"> 3<link rel="apple-touch-icon" sizes="152x152" href="/assets/webpack/icons-4b62aad7/apple-touch-icon-152x152.png"> 4<link rel="apple-touch-icon" sizes="180x180" href="/assets/webpack/icons-4b62aad7/apple-touch-icon-180x180.png">
but files will be saved to /icons-4b62aad7/
directory and you iconstats.json
contains correct outputFilePrefix
1{ "outputFilePrefix":"/assets/webpack/icons-4b62aad7/" }
prefix
change filenames inside html, output
it is the path where icons wiil be savedoutput
and want set corrent path in the manifest files and html files1 new AppManifestWebpackPlugin({ 2 // Your source logo 3 logo: 'my-logo.png', 4 // Output path can be relative. Icons will be saved to webpack output directory + output 5 output: '../icons/', 6 // Change prefix of files for correct paths in your html and manifest files 7 prefix: '/icons/' 8 })
When you use option emitStats
the plugin is generated stats file with statsFilename
and contains usefull data
1{ 2 "outputFilePrefix":"/", 3 "html": [], // array of html strings 4 "files": [], // array of generated icon names 5 "encodedHtml": "", // endoded html string if you use statsEncodeHtml option 6} 7
Take a look at the CHANGELOG.md.
You're free to contribute to this project by submitting issues and/or pull requests. This project is test-driven, so keep in mind that every change and new feature should be covered by tests. This project uses the semistandard code style.
This project is licensed under MIT.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
90 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More