When using code splitting for caching as described in this official guide you get a chunk manifest file generated by ChunkManifestPlugin that you should include in the HTML file. It would be nice if html-webpack-plugin could include it automatically.
Is it possible and a good idea? I am willing to help contributing but would need some input on where to start.
Or maybe this should be implemented as a separate plugin?
I really like the idea - could we start with a seperate plugin for now and integrate it as a second step?
integrating inlining of chunks' mapping into HTML Webpack Plugin sounds very promising, as this would be a trusted one-stop solution.
Nonetheless, there already is a plugin taking care of inlining: https://github.com/jouni-kantola/inline-chunk-manifest-html-webpack-plugin. Works.
@csentis exactly what I was looking for. Thanks! I think we can close this issue then
After @csentis reached out (https://github.com/jouni-kantola/inline-chunk-manifest-html-webpack-plugin/issues/1), I decided to publish the plugin to npm:
https://www.npmjs.com/package/inline-chunk-manifest-html-webpack-plugin
Thanks for feedback, @csentis!
@jantimon: The plugin is pretty naive, but please have a look at it and see if you find it useful.
I've now upgraded inline-chunk-manifest-html-webpack-plugin so that the chunk manifest can be inlined with a variable in the template (ex: https://github.com/jouni-kantola/webpack-output-by-build-type/blob/master/tmpl/index.ejs).
I didn't know this option existed until the following issue: https://github.com/jouni-kantola/inline-chunk-manifest-html-webpack-plugin/issues/3.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I really like the idea - could we start with a seperate plugin for now and integrate it as a second step?