arthurbergmz / webpack-pwa-manifest

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

doesn't work with webpack-manifest-plugin #32

Open senid231 opened 6 years ago

senid231 commented 6 years ago

webpack-manifest-plugin is plugin for creating assets manifest. It creates JSON file with a mapping of all source file names to their corresponding output file. But manifest created with webpack-pwa-manifest not appear in assets manifest

i think it's related to https://github.com/danethurber/webpack-manifest-plugin/issues/102#issuecomment-354864931

but maybe it can be solved from side of webpack-pwa-manifest ?

arthurbergmz commented 6 years ago

I can try to figure it out, but since both of them use the 'emit' event, there is no way yet to webpack-manifest-plugin retrieve files generated by this plugin, I guess.

I'll keep this issue under discussion.

mikemix commented 4 years ago

I'm using Webpack 4.3. The generated manifest file indeed appears in the asset manifest file, but the key is invalid, should be:

"build/manifest.json": "/build/manifest.a9031d64929e9c54d88c7a0b4cc11f47.json",

but is instead

"build/manifest.a9031d64929e9c54d88c7a0b4cc11f47.json": "/build/manifest.a9031d64929e9c54d88c7a0b4cc11f47.json",

meaning it's not valid and I cannot use it. Don't know which plugin is responsible for this though :(

maps82 commented 3 years ago

To fix the problem described by @mikemix I use the map option of the webpack-manifest-plugin to change the key of the web manifest file:

...
.configureManifestPlugin((options) => {
    options.map = (file) => {
      if (/^build\/webmanifest\..+\.json$/.test(file.name)) {
        file.name = 'build/webmanifest.json';
      }
      return file;
    };
})
...

(Note this is webpack encore, not a pure webpack config...)

molfar commented 3 years ago

Have the same issue with webpack 4.46.0