arthurbergmz / webpack-pwa-manifest

Progressive Web App Manifest Generator for Webpack, with auto icon resizing and fingerprinting support.
MIT License
514 stars 94 forks source link

The url was not resolved for icons in shortcut section. #140

Open Momijiichigo opened 3 years ago

Momijiichigo commented 3 years ago

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.