Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

[fix] fix duplicate outputs when using with multiple instances of HtmlWebpackPlugin #37

Merged
merged 1 commit into from
Dec 18, 2017

Conversation

toxic-johann
Copy link
Contributor

I found a way to fix Duplicate outputs when using with multiple instances of HtmlWebpackPlugin.

It cause by two bug.

  1. filesToInclude is shared by multiple compilation, which caused duplication.
  2. It hasn't check if the chunk belong to the page, so it will inject all the chunk into every page.

solution

  1. I move filesToInclude into each compilation. So they won't interfere with each other
  2. I check the chunk by renderedHash, which is used by htmlWebpackPlugin.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If your company signed a CLA, they designated a Point of Contact who decides which employees are authorized to participate. You may need to contact the Point of Contact for your company and ask to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
  • In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again.

@toxic-johann
Copy link
Contributor Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@toxic-johann
Copy link
Contributor Author

hmmmm... Can someone review the pr ?

@9renpoto
Copy link

9renpoto commented Dec 4, 2017

@toxic-johann Thanks! this PR works my project! 👍

@addyosmani Please review it.

@jeffposnick
Copy link
Contributor

@addyosmani has asked me to lend a hand with this repo.

I don't see any red flags with this PR, and I trust based on the reactions and comments that it solves a problem that many folks were running into, so I'm fine with merging.

My one question for @toxic-johann is whether you'd consider this a major or minor change from a semver perspective (i.e. does it "break" existing functionality that others might have depended on). I'm trying to determine whether to tag this new code 2.1.0 or 3.0.0 on npm.

@toxic-johann
Copy link
Contributor Author

@jeffposnick just a minor change

@jeffposnick
Copy link
Contributor

Thanks for confirming, and thanks for everyone's patience.

@jeffposnick jeffposnick merged commit c88ba96 into GoogleChromeLabs:master Dec 18, 2017
@jeffposnick
Copy link
Contributor

(I'll publish 2.1.0 to npm soon—I've asked @addyosmani to add me as an owner there.)

@jeffposnick
Copy link
Contributor

2.1.0 is now live on npm, and tagged on GitHub: https://github.com/GoogleChromeLabs/preload-webpack-plugin/releases/tag/v2.1.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate outputs when using with multiple instances of HtmlWebpackPlugin
4 participants