-
-
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
static assets in CSS url() without opening slash is not resolved or bundled #9800
Closed
7 tasks done
Labels
inconsistency
Inconsistency between dev & build
p2-nice-to-have
Not breaking anything but nice to have (priority)
Comments
Paths without the first I think we need a warning or make it consistent. |
sapphi-red
added
p2-nice-to-have
Not breaking anything but nice to have (priority)
inconsistency
Inconsistency between dev & build
labels
Aug 23, 2022
Megrax
added a commit
to Megrax/vite
that referenced
this issue
Oct 3, 2022
9 tasks
patak-dev
pushed a commit
that referenced
this issue
Oct 24, 2022
#10331) Co-authored-by: 翠 / green <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
inconsistency
Inconsistency between dev & build
p2-nice-to-have
Not breaking anything but nice to have (priority)
Describe the bug
Static assets in CSS url() without opening slash
/
is not resolved or bundled withvite build
.For example,
background-image: url('src/assets/sample.svg')
will remain as is, without any file copied or path changed.But
background-image: url('/src/assets/sample.svg')
will work correctly, with path changed tourl('/assets/sample.svg')
and file copied.Both of the above are working correctly in
dev
mode.I'm not sure if it's my problem or my responsibility to ensure the opening slash exists, but I can't find any related info in the doc or here. Sorry if I just missed something.
Reproduction
https://stackblitz.com/edit/vitejs-vite-2j2snf?file=src/App.css
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: