-
Notifications
You must be signed in to change notification settings - Fork 4.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
Process Tailwind output with Vite CSS plugins #13218
Conversation
@ArnaudBarre I'm interested in your review here. In particular, do you see any cases where this won't work with other plugins correctly? |
Answered in Discord: this way of doing things doesn't make the CSS hash independent of the utils content. To workaround that I found that calling again the transform function of the |
a9f1bc7
to
4e8b9c5
Compare
@ArnaudBarre The PR has been updated to apply the |
23351b5
to
0a4d7df
Compare
Some small changes but otherwise looks good and appears to work quite well. 💯 |
We were using setTimeout to wait for the initial scan to complete before generating Tailwind CSS. Now that full builds wait until the bundle stage, dev builds can simply run immediately. This might generate Tailwind CSS twice, generating a FOUC, but will be faster than waiting for the timeout. A [proposed Vite change](vitejs/vite#16135) could address the FOUC and extra build.
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Jordan Pittman <jordan@cryptica.me>
4b077e2
to
5557aeb
Compare
Transform Tailwind-generated CSS with Vite CSS plugins.
vite:css
does useful things like transformingurl()
paths and inlining images.vite:css-post
generates bundle hashes. Before this change, the CSS bundle hash wasn't changing when the generated CSS changed.