brunocodutra / webapp-webpack-plugin

[DEPRECATED] use favicons-webpack-plugin instead
https://www.npmjs.com/package/webapp-webpack-plugin
MIT License
125 stars 17 forks source link

Multiple icons sources? #174

Closed wclr closed 5 years ago

wclr commented 5 years ago

If I would like to use different source files for different platforms? Maybe multiple favicons configs should help?

brunocodutra commented 5 years ago

I'm not sure I fully understand the use-case, could you elaborate on what exactly you're trying to achieve?

From what I understand, wouldn't it be sufficient to have different configurations for webapp-webpack-plugin which are picked and added to the plugins array according to the platform?

wclr commented 5 years ago

My case is actually: for favicon used (in the browser tab) I want to use one icon, and for other stuff (like icons on devices / splash screens) another.

brunocodutra commented 5 years ago

You should be able to do it by having two separate instances of webapp-webpack-plugin

plugins: [
  new WebappWebpackPlugin({
    logo: 'a.png', // for the browser tab
    // ...
    favicons: {
      // ...
      icons: {
        android: false,
        appleIcon: false,
        appleStartup: false,
        coast: false,
        favicons: true,
        firefox: false,
        windows: false,
        yandex: false
    }
  }),

  new WebappWebpackPlugin({
    logo: 'b.png', // everywhere else
    // ...
    favicons: {
      // ...
      icons: {
        android: true,
        appleIcon: true,
        appleStartup: true,
        coast: true,
        favicons: false,
        firefox: true,
        windows: true,
        yandex: true
    }
  })
]
wclr commented 5 years ago

what about generating the manifest file?

brunocodutra commented 5 years ago

You mean manifest.json? It's generated if android: true and is completely independent of the other kinds of icons.

wclr commented 5 years ago

Ah ok. Thanks for the elaboration. Think may close.