Skip to content

This webpack plugin purpose is to create images for all important platform icons out of one icon file

License

Notifications You must be signed in to change notification settings

mutefiRe/webpack-pwa-icons-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

    npm install --save-dev webpack-pwa-icons-plugin

Usage

webpack.config.js

const WebpackPWAIconsPlugin = require('webpack-pwa-icons-plugin')

const options = {
  iconUrl: 'public/img/icons/logo.svg', // Define the url to the icon, which you want to use for generation
  backgroundColor: "#376eab", // Define backgroundColor you want to use for Platforms, which doesn't support transparency
  outputDir: 'dist/img/icons/', // Define Output directory
}

const config = {
  plugins: [
    new WebpackPWAIconsPlugin(options)
  ]
}

Additional Options

extend

You can extend the default Presets with own icon definitions, to generate them:

  extend: [
    {size: 150, filename: 'custom-icon.png', background: false},
    {size: 180, filename: 'custom-icon-ios.png', background: true}
  ]

custom

You can replace the default Presets with own icon definitions, to generate them:

  [
    {size: 150, filename: 'custom-icon.png', background: false},
    {size: 180, filename: 'custom-icon-ios.png', background: true}
  ]

You can't use extend and custom at the same time.

About

This webpack plugin purpose is to create images for all important platform icons out of one icon file

Resources

License

Stars

Watchers

Forks

Packages

No packages published