flareact / flareact

Edge-rendered React framework built for Cloudflare Workers
https://flareact.com
MIT License
1.82k stars 77 forks source link

Tailwindcss / style-loader no styles #79

Closed tomsiwik closed 3 years ago

tomsiwik commented 3 years ago

Hi. Thanks for the great idea with cloudflare worker nextjs. I like where this project is headed.

Currently I'm facing a problem with postcss, tailwindcss and style-loader. With postcss 8 the configuration isn't picking up any styles from tailwindcss. I've successfully replicated the problem in a fork of the with-typescript example.

https://github.com/tomsiwik/with-tailwindcss

I've tried various configuration overrides without much success. I'm also not sure if this is related to the postcss upgrades of the canary version. This started since postcss and my renovate updates when I had to override the postcss config (just like you did with the recent version). Since then: poof... tailwindcss gone.

Hope this helps, you are aware of the issue and might have some ideas. Cheers

jplhomer commented 3 years ago

Hey @tomsiwik super interesting!

I noticed you're hosting pages in a src directory. Is it possible that your custom _app component is not being used at all?

Notice that Flareact passes a Webpack context containing the pages directory in the worker entrypoint: https://github.com/tomsiwik/with-tailwindcss/blob/master/src/index.js#L15 In this scenario, it's possible there wouldn't be any pages for it to find at all.

Let me know if that helps!

tomsiwik commented 3 years ago

Hmm. You are right. How can I change the behaviour to start all the work from ./src (similar with nextjs' approach: https://nextjs.org/docs/advanced-features/src-directory)? For now leaving everything on root would be the workaround I guess.

Edit: just tried moving everything to the root - works again. Thank you for the help.

jplhomer commented 3 years ago

Great to hear! Yeah, unfortunately no way to specify a different root at this time.