Differences between dev and prod (for example with css)
Hello, I'm trying to understand why we have differences in dev server and prod server.
For example importing the tailwind css globals like this (in __root.tsx)
import "@/app/styles/globals.css";
I can see styles in dev but not in PROD. We need to add ?url
and import it as a link .
Im trying to understand why is that the case? Because right now I'm trying to use unplugin-fonts/vite
for fonts and there I need to import it like this: import "unfonts.css";
and again it works in dev but not in prod. I can for example see that it generated a ssr-[hash].css
file inside of the assets folder (which includes the font css) but this file itself is not part of the generated index.html
so thats why I can not see the font in PROD.
My questions are:
1. why do we have this different behaviour
2. what options/workarounds do we have here to solve this?
Any help is appreciated4 Replies
vicious-goldOP•12mo ago
So it looks like this only is an issue if you use prerendering option
flat-fuchsia•12mo ago
can you elaborate? I have the same issue
vicious-goldOP•12mo ago
are you using unplugin-fonts or what are you doing exactly?
flat-fuchsia•12mo ago