CSS/Stylesheet Injected Twice Into Head
See original GitHub issueHey, thanks for the great Plugin! I had a hard time with webpack & setting up dynamic imports. This is just working out of the box.
I’m having an issue with Stylesheets, which maybe related to vite, not this plugin, but to be sure I also post here. I already replied to the existing issue on vite.
I’m building a page with preact-client-routing example as startpoint. The issue with multiple injected styles exists inside this untouched repo. Just clone and try.
I’m using the newest version of the example.
If running npm run dev
the import './PageShell.css'
inside PageShell.jsx
is injected as stylesheet and additionally as <style />
tag in the head. You also see the styles always two times inside the styles inspector.
If running npm run build
and npm run server:prod
it is injected twice as stylesheet, here _default.page.client.jsx.2942c7fb.css
.
It would be great if this is fixed soon or eventually clarify if this is a vite issue. Thanks.
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
Had a look and it’s necessary to avoid CSS flashing. See comments in the commit.
Thanks for the digging.
Good catch, will have a look at it tomorrow.