-
Notifications
You must be signed in to change notification settings - Fork 143
Implement webpack 4 support #57
Conversation
…or prefetches async chunks
@toxic-johann Thanks for submitting this. I'm not sure which issues you were seeing with |
@jfsiii Thanks for the advice. The problem is fixed in the latest version. |
@jeffposnick Do you have time to review my pr? Or should i implement this based on v3? |
👏 |
package.json
Outdated
"extract-text-webpack-plugin": "^4.0.0-beta.0", | ||
"file-loader": "^1.1.11", | ||
"html-webpack-plugin": "^3.0.4", | ||
"jasmin": "0.0.2", |
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.
that looks like it got added by mistake? "jasmin" package
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.
Yes. That's a mistake.
Thanks a ton for working on this, @toxic-johann! I've also started work on the webpack v4 story, but I'd like to maintain legacy webpack support in the same version. I've also been refactoring the codebase to break things out into smaller modules. I'd love to incorporate some of the changes you made in this PR into the v3 codebase—in particular, the changes for You can see where things stand with, e.g., https://github.com/GoogleChromeLabs/preload-webpack-plugin/blob/v3/src/lib/does-chunk-belong-to-html.js So... you could either file a PR against the v3 branch with a subset of these changes, or I'm happy to extract the relevant bits around chunk groups and incorporate it as part of the work that I've been doing over the past few days (giving you credit in the code). |
Thanks, @jeffposnick . Both ways are ok. I will try to file a pr against v3 this weekend, if i have time. As for the legacy webpack support in master branch, I think I can finished in this pr. |
@jeffposnick Now the master branch can support both webpack v3 and webpack v4. |
Thanks a lot for working through this, @toxic-johann! My current plan is to merge this into |
I agree. And I will try to make some help on |
(FYI, @toxic-johann, I've ported what I think is equivalent logic into the latest commits in the v3 branch. So don't feel obligated to spend time on it at the moment.) |
That's great!! |
A pull request to fix #52
It mainly change this two part.
But this change do not compatible webpack < 4. If we need that, we need two whole different logic, I think it's better to provide two version.
It pass 16/17 of the unit test, one failed is because
extract-text-webpack-plugin
do not support webpack4 well.