webpack-pwa-manifest icon indicating copy to clipboard operation
webpack-pwa-manifest copied to clipboard

The url was not resolved for icons in shortcut section.

Open Momijiichigo opened this issue 3 years ago • 0 comments

I wanted my PWA to have shortcut functionality, so I wrote the code below in the part new WebpackPwaManifest({~~~}):

icons: [
        {
          src: path.resolve("./icon/logo.png"),  // the URL resolved
          sizes: [96,192,512],
          type: "image/png"
        },
      ],
shortcuts: [
        {
          name: "shortcut 1",
          short_name: "shortcut 1",
          description: "hello",
          url: "./index.html?call=shortcut&content=shortcut1",
          icons: [
            { 
              src: path.resolve("./icon/icon_96.png"),   // the URL was not resolved
              sizes: "96x96"
            }
          ]
        },
...

The URLs of PWA's icons were resolved(i.e. png files appear in my dist/ folder and my manifest file states the corresponding location). However the URLs of the icons in the shortcut section in the result file were just the same as the original URL(./icon/icon_96.png), and the corresponding icon files were not created in dist/ folder. Could you fix this? Thank you for your time! And I apologize for my poor English.

Momijiichigo avatar Oct 08 '20 09:10 Momijiichigo