Assets with the same content are de-duplicated at build time
See original GitHub issueDescribe the bug
Hi! I have many assets like svg and their [content] is the same. After vite build, I only got two svg. The rest have been merged together. I checked the code of vite in https://github.com/vitejs/vite/blob/2b7e836f84b56b5f3dc81e0f5f161a9b5f9154c0/packages/vite/src/node/plugins/asset.ts#L325. Is this made wrong? Or is this the default behavior of rollup. How can I get all assests after build? I don’t want chunk splitting.
Reproduction
https://stackblitz.com/edit/vitejs-output-file-paths-gftt9h?file=dist/manifest.json
System Info
vite 2.9.12
Used Package Manager
pnpm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:19 (16 by maintainers)
Top Results From Across the Web
How do I avoid duplicate assets in a DAM?
If two assets have the same checksum, they are exact duplicates. How does it work with assets? Add a period in a text...
Read more >Deduplication/merging of mutable data in Python
My script is supposed to query each of them, gather that data, deduplicate it by merging info about the same assets from different...
Read more >Using the Amazon SQS message deduplication ID
Messages sent with identical content but different message attributes that Amazon SQS must ... The deduplication process in FIFO queues is time-sensitive.
Read more >How best to avoid asset duplication? (VM & Agent)
Hi Folks, I was hoping to hear how some of you avoid ending up with duplicate assets (cloud agent & ip asset imported...
Read more >BigQuery Deduplication
Do you ever get duplicate rows in BigQuery? I'm going to explore some techniques for deduplication in BigQuery both for the whole table...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am trying to cache packed results. Because my project structure is multi-page, and each page is not directly related, the speed will be slower every time it is fully bundled, so I need know whether the file needs to be removed from the cache by controlling the
hash
. And multi-asset merging will cause cache instability. My need is very rare, so I don’t think there is any need to modify the vite source code. At first I thought it was a vite bundle bug. But I now think merging assets is reasonable for the vast majority of projects. Thank you for your enthusiasm and responsibility@hemengke1997 Yes I understand the difference. But we didn’t understand why you need to avoid the dedupe of the actual file. Would you provide more context about that?