Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: css modules #446

Merged
merged 3 commits into from
Feb 4, 2024
Merged

fix: css modules #446

merged 3 commits into from
Feb 4, 2024

Conversation

Aslemammad
Copy link
Contributor

Resolves #439

The #427 PR treated all the CSS files the same way. CSS modules in vite act like real scripts and there's no way to ssr transform them and get the actual CSS, instead, we get the CSS keys that we should use in our general files.

What I do in this PR is revert the script injecting way of loading CSS, only for CSS modules, and for fixing FOUC, I make that script blocking, which is not ideal at all, but works for now.

I see right now also that hmr with CSS modules in server components is broken since I guess hmr does not work well in server components.

Copy link

vercel bot commented Feb 4, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Feb 4, 2024 7:41am

Copy link

codesandbox-ci bot commented Feb 4, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 9a31b7e:

Sandbox Source
Vanilla Typescript Configuration
React Configuration
React TypeScript Configuration

Copy link
Owner

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great.

Not a big fan of all those hacks, but no idea from me. Definitely worth revisiting.

@dai-shi dai-shi merged commit 274dc34 into dai-shi:main Feb 4, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS modules broken in DEV after #427
2 participants