-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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(css): .css?url
support
#15259
fix(css): .css?url
support
#15259
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Is there a reason this is supported? I can't quite think of a case where a user would use this, using plain |
I added it for compat for |
.css?url
/.css?raw&url
support.css?url
support
In the last meeting, we discussed that we should add I removed the |
/ecosystem-ci run |
📝 Ran ecosystem CI on
|
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.
Nuxt fail seems unrelated. Awesome work @sapphi-red 💚
There appears to be a similar issue with SCSS. Say I have: import selectStyles from "somePackage/Select.scss?inline";
export const Theme = () => <style>{selectStyles}</style>; And that :root,
:host {
--select-icon: url("./chevron.svg");
}
.selectStyles {
background-image: var(--select-icon);
} Vite thinks that |
Hey @josephmarkus! Your comment in this merged PR will be quickly lost in the repo activity. Would you create a new issue with a minimal reproduction against the latest Vite so we can properly track the problem you are reporting? |
Was just filling in a bug report and whilst reproducing the error realised that my SCSS file imports another SCSS file, but if I target the end file directly, Vite resolves everything fine, so maybe not an issue 🤷♂️ |
Description
.css?url
now returns a URL to transformed CSS.css?raw&url
now returns a URL to raw CSSnote that.css?raw
returns a JS module (export default ".foo {}"
) but.css?raw&url
returns a URL to CSS file (.foo {}
).module.css?url
now throws an error{ 'foo': 'foo_hash' }
) without injecting the actual CSSfixes #2522
fixes #7842
fixes #13416
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).