Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@chapiter/favicons-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chapiter/favicons-webpack-plugin

Webpack favicons genterator, powered by t by RFG Api https://realfavicongenerator.net/api .

  • 2.1.2
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@chapiter/favicons-webpack-plugin

Generate favicons using RealFaviconGenerator as part of your Webpack build process.

Install

yarn add --dev @chapiter/favicons-webpack-plugin
npm i --save-dev @chapiter/favicons-webpack-plugin

Usage

In your Webpack config:

webpack.config.js

const FaviconsWebpackPlugin = require('@chapiter/favicons-webpack-plugin');

module.exports = {
  plugins: [
    new FaviconsWebpackPlugin({
      faviconJson: path.resolve(__dirname, 'favicon.json'),
      outputPath: 'assets/favicons', // relative path of `webpack` output path.
      inject: true
    })
  ]
}

The options are:

  • faviconJson (required): the path to a JSON configuration file from the RFG website
  • outputPath (required): the path where the plugin will output the favicon files generated from your config
  • inject (optional): if true, hooks into HtmlWebpackPlugin to inject <link> tags for your favicons into your HTML

favicon.json

{
    "masterPicture": "TODO: Path to your master picture",
    "iconsPath": "/assets/favicons",
    "design": {
        "ios": {
            "masterPicture": {
                "type": "inline",
                "content": "[TODO: Copy the base64-encoded content of the image here]"
            },
            "pictureAspect": "backgroundAndMargin",
            "backgroundColor": "#ffffff",
            "margin": "0%",
            "assets": {
                "ios6AndPriorIcons": false,
                "ios7AndLaterIcons": false,
                "precomposedIcons": false,
                "declareOnlyDefaultIcon": true
            },
            "appName": "App Name"
        },
        "desktopBrowser": {
            "design": "background",
            "backgroundColor": "#ffffff",
            "backgroundRadius": 0.1,
            "imageScale": 1
        },
        "windows": {
            "masterPicture": {
                "type": "inline",
                "content": "[TODO: Copy the base64-encoded content of the image here]"
            },
            "pictureAspect": "whiteSilhouette",
            "backgroundColor": "#ff3333",
            "onConflict": "override",
            "assets": {
                "windows80Ie10Tile": false,
                "windows10Ie11EdgeTiles": {
                    "small": false,
                    "medium": true,
                    "big": false,
                    "rectangle": false
                }
            },
            "appName": "App Name"
        },
        "androidChrome": {
            "masterPicture": {
                "type": "inline",
                "content": "[TODO: Copy the base64-encoded content of the image here]"
            },
            "pictureAspect": "backgroundAndMargin",
            "margin": "0%",
            "backgroundColor": "#ffffff",
            "themeColor": "#ffffff",
            "manifest": {
                "name": "App Name",
                "startUrl": "[http://example]",
                "display": "standalone",
                "orientation": "notSet",
                "onConflict": "override",
                "declared": true
            },
            "assets": {
                "legacyIcon": false,
                "lowResolutionIcons": false
            }
        },
        "safariPinnedTab": {
            "masterPicture": {
                "type": "inline",
                "content": "[TODO: Copy the base64-encoded content of the image here]"
            },
            "pictureAspect": "silhouette",
            "themeColor": "#ff3333"
        }
    },
    "settings": {
        "scalingAlgorithm": "Mitchell",
        "errorOnImageTooSmall": false,
        "readmeFile": true,
        "htmlCodeFile": true,
        "usePathAsIs": false
    }
}

Note that the inject option requires you to be using html-webpack-plugin. It also requires you to have set settings.htmlCodeFile: true in your faviconJson configuration file (the "Generate html_code.html" option when generating the configuration on the RFG website).

Generated files

The plugin will generate files based on your configuration file. Generally these will include one or more favicon images, and possibly some browser- or device-specific files such as browserconfig.xml for IE11.

Keywords

FAQs

Package last updated on 15 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc