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

Invalid CSS produced with Vite 3 when using a base path #53

Open
Artur- opened this issue Aug 16, 2022 · 0 comments · May be fixed by #54
Open

Invalid CSS produced with Vite 3 when using a base path #53

Artur- opened this issue Aug 16, 2022 · 0 comments · May be fixed by #54

Comments

@Artur-
Copy link

Artur- commented Aug 16, 2022

The original issue was created in vitejs/vite#9694

With Vite 3 the CSS in JS can be of the type

const a = 'foo '+someJS + 'bar';

in practice it is used for calculating relative URLs

When the string is wrapped by this plugin, it is changed to a format where the JS is no longer executed and you end up with something like this in the final CSS

@font-face{font-family:Line Awesome Brands;font-style:normal;font-weight:400;font-display:auto;src:url("+new URL('la-brands-400.c0e32387.eot', import.meta.url).href+");

Not sure if the escaping can be fixed or worked around here or if this needs to be fixed in Vite

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