-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Cache chunks result between multiple entry point html page #802
Conversation
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.
Thank you for the PR :)
looks good so far, just a few changes
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ |
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.
Can you revert the changes on this file please
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.
Has been reverted
index.js
Outdated
* @param compilation | ||
* @return {Array} | ||
*/ | ||
HtmlWebpackPlugin.prototype.getAllChunks = function (compilation) { |
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.
I don't think it should returns only the chunks
, it should return the whole JSON so we can use it for
Line 255 in aedc623
webpack: compilation.getStats().toJson(), |
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.
Push new opt commit, these two places are handled uniformly
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.
lgtm thank you
@mastilver what is missing to merge this PR? |
well I really need this PR, My project have 50 entries now.. |
Hey guys, what's the status on this? Failing test? I'm also wondering (and I mentioned this on another issue before): How come we need to use |
HtmlWebpackPlugin.prototype.getCompilationStats = function (compilation) { | ||
var stats = compilationHashToStatsMap[compilation.hash]; | ||
if (!stats) { | ||
stats = compilation.getStats().toJson(); |
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.
This toJson
call can be passed a number of false
options for specific keys to save more time, and limit generation to only the chunk information (which is all that's used by this plugin). You can see an example of that here in another perf PR: https://github.com/jantimon/html-webpack-plugin/pull/825/files#diff-168726dbe96b3ce427e7fedce31bb0bcL67
|
i don't know why the test failed, what can i do for this pr to merge.@mastilver |
My project have 100+ entries, it's very slow. I really need this PR, to improve pref. |
Please merge. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In some time the method
compilation.getStats().toJson()
take long.At my project, it takes about 1 to 3s, and I have 155 pages, it will take 155 to 460s total, too slow.
Cache the chunks result between entry points, it will reduce a lot of time.