-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
fix: Only include initial chunks #48
Conversation
Do we need the Couldn't you use |
What is chunk.initial or chunk.isInitial()? |
it's a boolean on chunk that tell if they are required on initial run
|
Thank you, As I understand isInitial might be a replacement for the But I'm not sure to make this new logic default for all users in the next minor version. |
I doubt it can be considered as a breaking change, |
lib/plugin.js
Outdated
// Don't add hot updates to manifest | ||
if (file.indexOf('hot-update') >= 0) { | ||
_.merge(manifest, compilation.chunks | ||
.filter(chunk => chunk => chunk.isInitial ? chunk.isInitial() : chunk.initial) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra chunk =>
done |
use chunk.isInitial
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, thank you 👍
I will release that later
@mastilver Hi! First of all thanks for your work on this project, we use it in the asset-pipeline at BuzzFeed. Unfortunately this change broke one of our applications this morning as it was relying on the dynamic chunks being included in the asset-manifest. We use these manifest entries to preload bundles ahead of time with |
Hey, we wanted to make it optional initially 😂 |
@Ianfeather Damn, I was really hoping for my first release to go smoothly... :/ I will revert that change for now, we can think for another solution later |
@Ianfeather, you should use chunk-manifest-webpack-plugin. I'm sorry about this my position, this change should be default but major |
@Ianfeather |
@a-x- I thing the right path to take is: by default include every single possible assets into the manifest and be able to have some filtering, I will put my thought down on an issue over the week-end, I will be happy to get your thoughts on that ;) |
ok, I can restore initial flagged functionality |
@mastilver Thanks for your quick turnaround on this! It's much appreciated. @a-x- thanks for the link to that project. That will also help us remove our webpack-runtime script too |
if (file.indexOf('hot-update') >= 0) { | ||
_.merge(manifest, compilation.chunks | ||
.filter(chunk => chunk.isInitial ? chunk.isInitial() : chunk.initial) | ||
.reduce(function(memo, chunk) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like if we use (memo, chunk) => {...}
we get the right context and we can skip .bind(this)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, got it
|
||
// Map original chunk name to output files. | ||
// For nameless chunks, just map the files directly. | ||
return chunk.files.reduce(function(memo, file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as /~https://github.com/danethurber/webpack-manifest-plugin/pull/48/files#r126661193, but will work only in combination with the previous (e.g. if both functions are arrow)
closes #46 Do not add code splitting bundles into manifest