-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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: add importedCss
and importedAssets
properties to RenderedChunk type
#6629
Conversation
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.
Looks like a clean refactor to me.
Queued for discussion in the next team meeting 👍🏼 |
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.
@aleclarson we talked about the PR in yesterday's meeting and we are good to move forward. The only change to merge is to nest importedAssets
and importedCss
in chunk.viteMetadata
, so we can later continue to expand the metadata without possible collisions with rollup (or other bundlers like WMR).
We also considered using an internal WeakMap and exposing a getViteChunkMetadata(chunk)
function instead but it looks less ergonomic to use.
I can make the suggested changes if needed (if you would prefer @aleclarson). |
@ElMassimo No need to ask, go right ahead ;) |
@patak-dev @aleclarson Applied the suggested changes in a pull request targeting this branch. Please review, and if it looks good we can go ahead and merge that one first. |
Although it's more verbose, it makes it easier to avoid collisions with rollup or other bundlers like WMR.
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.
Looks good! Thanks @ElMassimo for doing the changes. Lets check if we can start the 2.9 beta next week and merge this one then.
Description
Replace the internal
chunkToEmittedCssFileMap
andchunkToEmittedAssetsMap
variables with public properties added by Vite toRenderedChunk
objects in therenderChunk
phase.These can be useful for Vite-based frameworks that generate their own HTML. We also want to move toward decoupling the internal HTML/CSS/Asset plugins, and this feature helps with that.
What is the purpose of this pull request?