Closed alaendle closed 2 years ago
Seems only to be an issue while using npm run dev:serve
- npm run start
seems to do further optimization that lead to css references. Sorry, if this is clear to the experienced next.js
user; I'm a js newbie 😒 .
Interesting. Thanks, I'll look into this.
Seems to be a general next.js manner - at least https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss exposes the same odd behavior. Personally I become skeptical if behavior differs between development and production builds differ so much. So far I haven't recorded an issue at next.js because I have the feeling that the circumstance should be known there and I don't really know how to describe the problem correctly. In any case, it's not your project 🥳
First let me thank you for this great example 🎉 I used it to play around with SSR. However after disabling JS in the browser to take a real look on the pure server-side-rendered site I noticed that because of the JS imports of the CSS the CSS isn't included in the pre-rendered output.
Tried to realize a solution like discussed here https://github.com/vercel/next.js/discussions/12868#discussioncomment-292294; but I wasn't able to complete it and I'm also I'm unsure is this is the right way. So maybe you could give a point to the right direction? Is there a way to tell next.js to include the CSS; or do we really need a dirty workaround here?