Skip to content

Latest commit

 

History

History
81 lines (57 loc) · 1.7 KB

README.md

File metadata and controls

81 lines (57 loc) · 1.7 KB

craco-favicons

A craco plugin to leverage favicons-webpack-plugin, which in turn leverages favicons to generate icons.

Usage

  1. Add the craco-favicons plugin into your craco.config.js.

  2. Add a logo.png file to the root directory of the project.

  3. Profit.

/* craco.config.js */

const CracoFavIconsPlugin = require("craco-favicons");

module.exports = {
    plugins: [{
        plugin: CracoFavIconsPlugin
    }]
}

Or specify your own options:

/* craco.config.js */

const CracoFavIconsPlugin = require("craco-favicons");

module.exports = {
    plugins: [{
        plugin: CracoFavIconsPlugin,
        options: {
            logo: "./src/assets/images/app-logo.svg",
            inject: true,
            prefix: "static/icons/",
            favicons: {
                icons: {
                    android: { offset: 10 },
                    appleIcon: { offset: 10 },
                    coast: false,
                    yandex: false,
                    appleStartup: { offset: 10 },
                    firefox: false,
                    windows: false
                }
            }

        }
    }]
}

All options supplied are passed to favicons-webpack-plugin.

Please see https://github.com/jantimon/favicons-webpack-plugin#advanced-usage and https://github.com/itgalaxy/favicons#usage for more configuration info.

Prerequisites

Craco

Installing

npm

npm i craco-favicon -D

Or Yarn

yarn add craco-favicon -D

Acknowledgments