Skip to content

Comments

Fix duplicate styles in CSS output#58

Merged
thgh merged 1 commit intov4from
dedupe
Nov 3, 2023
Merged

Fix duplicate styles in CSS output#58
thgh merged 1 commit intov4from
dedupe

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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