-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example #1
Comments
👍 Please! This would be really helpful! |
I can't get it work, chunks IDs in manifest.json changes on every build. or I don't understand the idea :) |
Could definitely use an example. I get what this line means:
But I'm not sure how to provide the mapping to webpack... |
have found this:
and then: <script>
//<![CDATA[
window.webpackManifest = {"0":"0-bundle-bdbd995368b007bb18a7.js","2":"2-bundle-7ad34cf6445d875d8506.js","3":"3-bundle-f8745c8bc2319252b6de.js","4":"4-bundle-ec8f5ae62f2e8da11aa1.js","5":"authenticated-bundle-933816ada9534488d12f.js","6":"public-bundle-8eb73d97201bd2e4951b.js"}
//]]>
</script>
<script src="https://abc.cloudfront.net/assets/common-71a050793d79ce393b1e.js"></script>
<script src="https://abc.cloudfront.net/assets/public-bundle-8eb73d97201bd2e4951b.js"></script> as far as I understand it webpack will try to find IDs map in |
@deepsweet @kentcdodds yes, you just assign that manifest JSON to a global variable, presumably as some sort of Thanks for the link to the post! Does a better job of explaining. |
I've written an article on how to set it up. Would be happy for any feedback: https://medium.com/@okonetchnikov/long-term-caching-of-static-assets-with-webpack-1ecb139adb95 @deepsweet your issue is also mentioned in the article. You should use OccurenceOrderPlugin to fix this. I've also added a repository with a sample webpack.config: https://github.com/okonet/webpack-long-term-cache-demo |
Thanks a lot for this! |
Is there a plugin can help us inject webpackManifest to html automatically? |
@ibufu if you're talking about injecting |
I've published |
Add an example that shows why this plugin is helpful, and how it is used.
The text was updated successfully, but these errors were encountered: