Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: deduplicate assets with buffer source #4712
feat: deduplicate assets with buffer source #4712
Changes from 6 commits
8b248a7
670cdf7
22f9af6
131b6b2
7ad10a9
12ad13a
bacaf62
9dbffe1
aa9a4e1
7e41f02
c8484d6
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
As I see it, this test does not really have any assertions and a
function
test may not be the best fit for asset deduplication as it does not verify_expected
. Why not just extend the existingchunking-form
test as it was before Rollup 3: https://github.com/rollup/rollup/blob/69ff4181e701a0fe0026d0ba147f31bc86beffa8/test/chunking-form/samples/emit-file/deduplicate-assets/_config.jsWe had a test for buffer deduplication, so it should just be green again
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.
You could also include cross Buffer/string deduplication as well in the test by emitting each asset a third time using the other format.
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.
Ah, nice! I missed the
deduplicate-assets
test before. Extended it in rollup/rollup@9dbffe1
(#4712) and also added a different buffer source for completeness.I also didn't know that Rollup 2 was already deduplicating binary sources. So then there is even less of a reason for the option if this was already how things worked before. Is my understanding correct that cross-buffer/string deduplication didn't happen in Rollup 2 though?
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 is indeed a new feature!