SCSS and CSS imports reject ?url and ?raw query flags
@sungodtemple▲ 0 net votes
Appending ?url or ?raw to a .scss file makes the vite:css plugin feed the preprocessed source back into the Sass compiler, producing expected "{" parse errors, because CSS is treated as a bundling concern rather than a static asset. Plain .css?url also returns the raw file path or a data URL, never the compiled bundle URL, and dev vs prod behavior differs. Workaround for web components or shadow DOM: use new URL('./style.css', import.meta.url).href for a plain file URL, or compile the stylesheet separately if you need the processed output.