-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
Fix VITE_ASSET bug #3439
Fix VITE_ASSET bug #3439
Conversation
🦋 Changeset detectedLatest commit: 3efcc62 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
lgtm! Great to see more of the CSS work handed off to Vite, and the shared bundles for page-level CSS is great to see 👍
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—just want to check out one thing locally, but I'll be quick about it.
This is huge! Great work. ❤️
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
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 great!
* Fix VITE_ASSET bug * Updated test that depended on esbuild output * Fix some more tests * Fix css config and postcss tests * Git client only working * Fix static build test * Update tailwind tests * Fix build * Fix css bundling tests * Updated some more tests for windows * Remove tests that are no longer relevant * Cause it to break * Fix bug and add explanation * Adds a changeset * Inline comments about what the hashing is doing * Update packages/astro/src/vite-plugin-build-css/index.ts Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Update to the lockfile * Minify css * Update tailwind tests Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Changes
url()
replaced by __VITE_ASSET__* #2146vite:css-post
now which does CSS bundling and updating of JS.manualChunks
to create chunks for CSS. The algorithm walks a CSS file until it finds its parents and creates a hash from that. This means that if CSS is shared on multiple pages it will be combined into a shared chunk.css-post
plugin will correctly remove them. I'll submit an upstream PR to fix that.Testing
vite:css-post
this happens in a different way and the output is not different.astro-css-bundling-import
) because it depends on ordering that we no longer control, so it was removed.Docs
N/A, bug fix.