You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're running into an issue when refactoring this code to directly use emitFile because it doesn't deduplicate the file if a Buffer is passed instead of a string. But for Fonts we would also want to have deduplication.
Feature Proposal
In our case, by default we have [hash] in assetsFileNames, so if strings and Buffers would be deduplicated using hashes there wouldn't be a noticeable performance penalty.
I imagine this feature should be optional if a performance regression must be avoided for the case of assetsFileNames without [hash].
The text was updated successfully, but these errors were encountered:
Feature Use Case
Now that vite@4.0.0-alpha.0 is running on Rollup 3. We're checking if we could simplify our custom hashing of assets (we currently do hashing, deduplication, and filenames by hand) to use the standard Rollup asset handling. As an example, here we are hashing and deduplicating by hand before calling
emitFile
https://github.com/vitejs/vite/blob/cb84f37771fdc424b5656079a4765e7aee74cc25/packages/vite/src/node/plugins/asset.ts#L460.We're running into an issue when refactoring this code to directly use
emitFile
because it doesn't deduplicate the file if aBuffer
is passed instead of a string. But for Fonts we would also want to have deduplication.Feature Proposal
In our case, by default we have
[hash]
inassetsFileNames
, so if strings and Buffers would be deduplicated using hashes there wouldn't be a noticeable performance penalty.I imagine this feature should be optional if a performance regression must be avoided for the case of
assetsFileNames
without[hash]
.The text was updated successfully, but these errors were encountered: