Spomky-Labs / pwa-bundle

PHP library for generating a full featured PWA manifest
https://pwa.spomky-labs.com
MIT License
29 stars 1 forks source link

Better icons mgmt #45

Closed Spomky closed 3 months ago

Spomky commented 4 months ago

Description

At the moment, the icons must exist as an asset to be linked to the Manifest file. Without changing the configuration, it could be great to generate them on-the-fly when compiled

Example

pwa:
    icons:
        - src: "images/pwa/favicon.svg"
          sizes: [48]
          format: 'ico'
        - src: "images/pwa/favicon.svg"
          sizes: [96, 128, 256, 512, 1024]
          format: 'png'
        - src: "images/pwa/favicon.svg"
          sizes: [0]
        - src: "images/pwa/favicon.svg"
          purpose: 'maskable'
          sizes: [0]

Note that only 1 asset really exist

Manifest file in dev/prod

{
    "icons": [
        {
            "src": "/assets/pwa/favicon-xxxhashxxx.ico",
            "format": "image/ico"
            "sizes": "48x48"
        },
        {
            "src": "/assets/pwa/favicon-xxxhashxxx.png",
            "format": "image/png",
            "sizes": "96x96 128x128 256x256 512x512 1024x1024"
        },
        {
            "src": "/assets/pwa/favicon-xxxhashxxx.svg",
            "format": "image/svg",
            "sizes": "any"
        },
        {
            "src": "/assets/pwa/favicon-xxxhashxxx.svg",
            "format": "image/svg",
            "purpose": "maskable",
            "sizes": "any"
        }
    ]
}
tacman commented 4 months ago

What do you think of having a default favicon in the bundle, with instructions on how to customize? It seems like the first error I always get is favicon failing.

Spomky commented 3 months ago

Closing as not mature for now.

github-actions[bot] commented 2 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.