-
-
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
url()
in a CSS file imported by @import
is not resolved correctly when using lightningcss
#16457
Comments
Start a new pull request in StackBlitz Codeflow. |
Hello @1GBpendrive. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
It seems to happen because |
Thank you @sapphi-red |
url()
in a CSS file imported by @import
is not resolved correctly with lightningcss
url()
in a CSS file imported by @import
is not resolved correctly with lightningcssurl()
in a CSS file imported by @import
is not resolved correctly when using lightningcss
I was able to reproduce with that. I trimmed down the reproduction and clarified the issue description. |
Describe the bug
url()
inside a CSS file that is imported from a CSS file by@import
is not resolved correctly when usingcss.transformer: 'lightningcss'
. The same source code works withcss.transformer: 'postcss'
.original description
Hello.
When a CSS file is imported with .css?inline, it is correctly minified and transformed with
css.transformer=postcss
andbuild.cssMinify=esbuild
.When I change to
build.cssMinify=lightningcss
, the build process still works correctly. 👍However, when I change to
css.transformer=lightningcss
in vite.config.js, then the .css?inline isn't recognized anymore and when I run the build process of Vite, it prints a message in the console: "(...).css?inline didn't resolve at build time, it will remain unchanged to be resolved at runtime" 👎In the documentation, nothing is said about .css?inline being specific to postcss, so I expected it would work with lightningcss too.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-cil2qs?file=vite.config.js,src%2Fpages%2Fbeginning.css
Steps to reproduce
Run the script _vite:build.
You are going to see that the image Border.avif is not built into the dist folder, because the app.css file was not considered in the build process. I tried debugging and at least discarded the plugins as the cause.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: