vitejs / vite

Next generation frontend tooling. It's fast!
http://vitejs.dev
MIT License
66.85k stars 6k forks source link

Page reload not working for ?raw CSS imports #16396

Closed bigwigal closed 3 months ago

bigwigal commented 4 months ago

Describe the bug

The title says it really; page reload appears to have stopped working in Vite 5 for ?raw CSS (and possibly other) imports. I checked back and it is working in the latest v4 but looks to have stopped in v5. I've created a couple of projects on StackBlitz to show it working in v4 and not in v5 (remove commented out background-color on body and save).

We're using the imports to pull related CSS into (Lit) web components, which we've done purely to keep the JS/CSS separate and make things easier to work with. Any help will be much appreciated, as is all your hard work to date. Many thanks!

Reproduction

https://stackblitz.com/edit/vitejs-vite-qfytfv?file=style.css

Steps to reproduce

No response

System Info

System:
  OS: Windows 10 10.0.19045
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  Memory: 21.73 GB / 31.69 GB
Binaries:
  Node: 20.11.1 - C:\Program Files\nodejs\node.EXE
  npm: 10.2.4 - C:\Program Files\nodejs\npm.CMD
Browsers:
  Edge: Chromium (123.0.2420.65)
  Internet Explorer: 11.0.19041.3636
npmPackages:
  @vitejs/plugin-vue: ^5.0.4 => 5.0.4
  vite: ^5.2.6 => 5.2.6

Used Package Manager

npm

Logs

No response

Validations

stackblitz[bot] commented 4 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.