Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix duplicate styles in CSS output #58

Merged
merged 1 commit into from
Nov 3, 2023
Merged

Fix duplicate styles in CSS output #58

merged 1 commit into from
Nov 3, 2023

Conversation

pioug
Copy link
Collaborator

@pioug pioug commented Nov 2, 2023

I think this PR will fix #49 #55.

I was going through the issues and realized that my build in my project has repeated styles too.

https://accounts.bandlab.com/web-accounts/scripts/app-033141d7.css 👇
image

The number of duplicate copies of the css seems related to the number of dynamic import() statements used within the specific bundle. - #55

This was a good guess. I found a fix and added a test. I probably introduced this bug 🙈

Without the fix we would get:

.rollup {
  color: green;
  user-select: none;
}
.rollup {
  color: green;
  user-select: none;
}

@pioug pioug requested a review from thgh November 2, 2023 16:47
@thgh thgh merged commit edf6545 into v4 Nov 3, 2023
@thgh
Copy link
Owner

thgh commented Nov 3, 2023

Published as 4.5 🎉

@pioug
Copy link
Collaborator Author

pioug commented Nov 6, 2023

@thgh Can you double check the v4.5 release when you have time? When I look in the /dist on https://www.npmjs.com/package/rollup-plugin-css-only?activeTab=code, I don't see the updated version with the usage of Set(). So the bug still persists for me!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unreasonably long bundling time after updating rollup-plugin-css-only from 3.1.0 to 4.2.0
2 participants