tailwindcss-setup-examples
tailwindcss-setup-examples copied to clipboard
add create-react-app setup example
Thanks for this! How do you think this solution (using a separate build step just for Tailwind) compares to the solution outlined here that uses craco to extend create-react-app with proper PostCSS support?
https://github.com/facebook/create-react-app/issues/5843#issuecomment-439662008
I know create-react-app is pretty annoying in this regard since it doesn't have first-party support for PostCSS so every solution is going to be a workaround in some way or another, but I feel like a solution that hooks into the webpack build so that tailwind.config.js is watched automatically for changes and stuff would ultimately be better than using our little CLI tool.
I think this solution is the simplest one to set up and works fine for people who just want a Tailwind starter which was one of the reasons I included the default config as an optional step.
The advantage like you mentioned with craco is the fact that we don't need to restart the server if/when we change the config but there is the additional overhead of adding a package and risking using something that isn't updated.
The call is yours though. I am more than happy to update the PR with the PostCSS setup if you'd like. Also, I probably have a Rails example coming your way as well. 💪
Hi there! I've pushed in parallel another version that I use in my projects and which uses postcss, and some more tricks. Let you look at that here. 😉