jouni-kantola / inline-chunk-manifest-html-webpack-plugin Goto Github PK
View Code? Open in Web Editor NEWExtension plugin for html-webpack-plugin to inline webpack's chunk manifest. Default inlines in head tag.
License: MIT License
Extension plugin for html-webpack-plugin to inline webpack's chunk manifest. Default inlines in head tag.
License: MIT License
Not support in current version from webpack
Without dropAsset, the implicit injection works and manifest is inlined in html:
new InlineChunkManifestHtmlWebpackPlugin()
With dropAsset, the implicit injection doesn't work and manifest is not inlined in html:
new InlineChunkManifestHtmlWebpackPlugin({ dropAsset: true })
With dropAsset, the explicit injection doesn't work and manifest is not inlined in html:
<%= htmlWebpackPlugin.files.webpackChunkManifest %>
new InlineChunkManifestHtmlWebpackPlugin({ dropAsset: true, chunkManifestVariable: 'webpackChunkManifest' })
Hi @jouni-kantola, thank for this plugin which in my eyes is the leanest approach to the very specific use case it covers.
I had originally tried to cover inlining the chunks manifest by means of HTML Webpack Plugin (or plugins advertised as using its hooks).
Makes me wonder whether you might not want to get in touch with the author of HTML Webpack Plugin as he has offered here: jantimon/html-webpack-plugin#600. Could be an idea to have your plugin listed in his README or find better ways to further integrate your solution.
I have such config for html-webpack-plugin:
new HtmlWebpackPlugin({
template: './index.pug',
inject: false,
and with inject: false inline-chunk-manifest-html-webpack-plugin does not work, it does not add manifest to head tag. What should I do for inline-chunk-manifest-html-webpack-plugin to work with inject: false?
The plugin is not working with webpack 5
@NinoFloris reported the runtime asset having different hash even if contents are the same, after extracting the chunk manifest. Thank you!
This unnecessary cache bust would be nice to fix.
Started off in somewhat related issue, but not quite the same.
Problem: #14 (comment)
Solution suggestion: #14 (comment)
webpack 4 introduces changes so that multiple runtime chunks can be generated when using the new optimization features. This issue is for tracking and updating inline-chunk-manifest-html-webpack-plugin
as html-webpack-plugin is ready for webpack 4.
chunk-manifest-webpack-plugin doesn't provide enough information(only chunks).
I need to use webpack-manifest-plugin.
Since [email protected]
const ManifestPlugin = require ( 'webpack-manifest-plugin' );
const InlineChunkManifestHtmlWebpackPlugin = require ( 'inline-chunk-manifest-html-webpack-plugin' );
...
plugins: [
new ManifestPlugin ( { publicPath } ),
new InlineChunkManifestHtmlWebpackPlugin ( { manifestVariable: 'manifest' } ),
]
...
Using like above makes System.import('filename')
fail.
Maybe providing necessary plugin from a user like before is better idea?
chunk-manifest-webpack-plugin
should be a peerDependency. As a nested dependency, the maintainer of this project would need to routinely check and update this project's package.json whenever chunk-manifest-webpack-plugin
updates.
With webpack ^3.0.0 installed, the dependency of this plugin on "chunk-manifest-webpack-plugin": "~1.0.0"
(as listed in package.json
) results in a yarn warning:
warning "[email protected]" has incorrect peer dependency "webpack@^2.0.0".
Will you kindly consider whether an update of package.json
is doable?
Love this plugin!! Thank you for making this. I just noticed one issue and that is it leaves behind the manifest.json file in the build directory. It would really nice if it cleaned up the file after it had injected the contents into index.
Hi:
Even if the hash of assets information is extracted from the manifest.js file by html inline. but manifest.js file changes when assets change every time.
this part of the manifest.js file changes every time:
/******/ // objects to store loaded and loading chunks
/******/ var installedChunks = {
/******/ 10: 0
/******/ };
Unless this part is also extracted from the manifest.js file, cache problem will be solved.
Hey, thanks for this nice package! I’m in a bit of a crunch though, because I need to update from v1.1.2 to v2.0.0 due to a problem with chunk-manifest-webpack-plugin peer dependencies. Can’t figure out what changed though.
Judging by the semver bump there was a breaking change. What was it?
Two things would help greatly: adding a changelog (you can find some good tips at http://keepachangelog.com/en/1.0.0/) and tagging the commits at which you published the package.
Thanks again!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.