HorusGoul / vite-plugin-stylex

Vite Plugin for StyleX
MIT License
111 stars 11 forks source link

Add Waku framework support #21

Open himself65 opened 7 months ago

himself65 commented 7 months ago

See example https://github.com/dai-shi/waku/pull/286

HorusGoul commented 7 months ago

@himself65 Can you try adding @stylex stylesheet; to the App.css file? It works but the plugin will need some work to make it perfect (like builds having duplicated CSS).

Here's an example: https://github.com/HorusGoul/waku-stylex-demo

himself65 commented 7 months ago

@himself65 Can you try adding @stylex stylesheet; to the App.css file? It works but the plugin will need some work to make it perfect (like builds having duplicated CSS).

Here's an example: HorusGoul/waku-stylex-demo

https://github.com/HorusGoul/waku-stylex-demo/blob/90e3ae6d7be2dbbeb0f70170e0c8f0ac52b7b20f/src/components/Card.tsx#L1C1-L1C20

It's client component. It still doesn't work in the server component

HorusGoul commented 7 months ago

@himself65 Updated my demo to make it work:

https://github.com/HorusGoul/waku-stylex-demo/commit/b07efcc904744de09bf4b17db7da72120b85446d

Anyway, the emitted CSS is not good for builds, so there's still work to do on the plugin side.

I'll rename this issue to be about Waku.

himself65 commented 7 months ago

I got why your demo is working but not for me. You have one client component so that the CSS file will emit correctly.

There is one edge case for me, there are only all server components, that cause css is missing

himself65 commented 7 months ago

Oh, I think I just miss @stylex stylesheet; on the top of css. Everything looks good now. thx

HorusGoul commented 7 months ago

I will leave this issue open in case someone wants to pick it up in the future. The Waku framework is fairly new, and I prefer to wait a bit for it to stabilize before adding support to the plugin.