shellscape / webpack-manifest-plugin

webpack plugin for generating asset manifests
MIT License
1.44k stars 184 forks source link

Chunkless files #102

Closed eliseumds closed 6 years ago

eliseumds commented 6 years ago

Hi, is there a way to have the chunkless files included in the final JSON? This is the output of my build:

                     Asset       Size                   Chunks                    Chunk Names
               Toolbar.css  558 bytes                  Toolbar  [emitted]         Toolbar
                Toolbar.js    49.8 kB                  Toolbar  [emitted]         Toolbar
                  clamp.js    8.09 kB                    clamp  [emitted]         clamp
                croppie.js    65.1 kB                  croppie  [emitted]         croppie
element-resize-detector.js    68.2 kB  element-resize-detector  [emitted]         element-resize-detector
                  en_AU.js    14.4 kB                    en_AU  [emitted]         en_AU
     gaAutotrackPlugins.js     201 kB       gaAutotrackPlugins  [emitted]         gaAutotrackPlugins
              nprogress.js    12.3 kB                nprogress  [emitted]         nprogress
                 popper.js    82.1 kB                   popper  [emitted]         popper
         webpackRuntime.js    6.04 kB           webpackRuntime  [emitted]         webpackRuntime
                   app.css     258 kB                      app  [emitted]  [big]  app
                    app.js    3.89 MB                      app  [emitted]  [big]  app
                stats.json  444 bytes                           [emitted]
             manifest.json    1.06 kB                           [emitted]
          icon_512x512.png    24.8 kB                           [emitted]
          icon_384x384.png    20.7 kB                           [emitted]
          icon_256x256.png    11.9 kB                           [emitted]
          icon_192x192.png    9.34 kB                           [emitted]
          icon_128x128.png    5.67 kB                           [emitted]
            icon_96x96.png    4.32 kB                           [emitted]
                     sw.js    24.9 kB                           [emitted]
appcache/manifest.appcache  594 bytes                           [emitted]
    appcache/manifest.html   58 bytes                           [emitted]

As you can see, manifest.json (from webpack-pwa-manifest) is emitted but isn't included:

{
  "publicPath": "/public-hot/",
  "Toolbar.css": "Toolbar.css",
  "Toolbar.js": "Toolbar.js",
  "app.css": "app.css",
  "app.js": "app.js",
  "clamp.js": "clamp.js",
  "croppie.js": "croppie.js",
  "element-resize-detector.js": "element-resize-detector.js",
  "en_AU.js": "en_AU.js",
  "gaAutotrackPlugins.js": "gaAutotrackPlugins.js",
  "nprogress.js": "nprogress.js",
  "popper.js": "popper.js",
  "webpackRuntime.js": "webpackRuntime.js"
}

I'd appreciate any help. Thanks!

mastilver commented 6 years ago

Did you try v2?

mastilver commented 6 years ago

ping!

(I will be closing this ticket as I assume your issue was resolved)

eliseumds commented 6 years ago

Hi @mastilver, I did but got the same results (2.0.0-rc.1). Is there any new configuration parameter that is not in the README?

mastilver commented 6 years ago

@eliseumds do you mind sharing your webpack config? (or even better a repository)

Are you using copy-webpack-plugin for those?

phil-lgr commented 6 years ago

Hey, just want to make sure, is it supposed to work out of the box with copy-plugin? I'm debugging to see where the manifest plugin could see those.

phil-lgr commented 6 years ago

Just tried 2.0.0-rc.1 and worked right away! This is a really nice plugin, I am learning the webpack internal, I appreciate the inline comments 😄, thanks!

phil-lgr commented 6 years ago

Another thing, when using plugins for html-plugin (e.g. https://github.com/SimenB/add-asset-html-webpack-plugin), the files are ignored since those plugins use html-plugin's event to manipulate the assets before it's emitted.

html-plugin provides event that we could hook to. But I am not sure how to make this configurable.

What I am trying to do:

image

Do you see a way we could make webpack-manifest-plugin work nicely with html-plugin? I'd like to help if you can provide guidance.

senid231 commented 6 years ago

file generated by https://github.com/arthurbergmz/webpack-pwa-manifest plugin also not appear in assets manifest

https://github.com/arthurbergmz/webpack-pwa-manifest/issues/32

mastilver commented 6 years ago

@senid231 I would expect this to be fixed on webpack@4 (just define manifest plugin after)

mastilver commented 6 years ago

@eliseumds Closing this due to inactivity

@senid231 Feel free to open a new PR, to talk about your issue

senid231 commented 6 years ago

@mastilver thanks, I'll check it with webpack@4

eliseumds commented 6 years ago

Latest version indeed works with Webpack 4 🎉

@mastilver I'm sorry for disappearing.

mikemix commented 5 years ago

Well it does appear in Webpack4 in the asset manifest file, but an invalid key is generated:

Is:

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

Should be:

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

molfar commented 3 years ago

I have the same issue with webpack 4 - it does not include generated webmanifest from webpack-pwa-manifest into asset manifest file at all