brunocodutra/webapp-webpack-plugin

Multiple icons sources?

wclr opened this issue · 6 comments

wclr commented

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

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

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.

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

what about generating the manifest file?

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

wclr commented

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