Skip to content
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

Rewrite urls in CSS files when using Vite #14877

Open
wants to merge 4 commits into
base: next
Choose a base branch
from

Conversation

thecrypticace
Copy link
Contributor

@thecrypticace thecrypticace commented Nov 5, 2024

Fixes #14784

This is an alternative to #14850 in which we actually perform url rewriting / rebasing ourselves. We ported a large portion of the URL-rewriting code from Vite (with attribution) to use here with some minor modifications. We've added test cases for the url rewriting so verifying individual cases is easy. We also wrote integration tests for Vite that use PostCSS and Lightning CSS that verify that files are found and inlined or relocated/renamed as necessary.

We also did some manual testing in the Playground to verify that this works as expected across several CSS files and directories which you can see a screenshot from here:

Screenshot 2024-11-05 at 10 25 16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[4 alpha] breaks the default Vite url(...) references in imported CSS files.
1 participant