[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
[X] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
If you use URL fragments (
url('foo#bar')
) inside CSS they will not be resolved using aliases from Vite config.Reproduction
https://stackblitz.com/edit/vitejs-vite-k7ay22?file=style.css
Steps to reproduce
background: url('my.svg#some-image')
When using reproduction link:
#fragment
)#test
)url(fragment.svg#test)
tourl('/folder/fragment.svg')
System Info
Used Package Manager
yarn
Logs
No response
Validations