Great news people! Create React App v5 is just released with a bunch of upgrades such as support for Webpack 5, PostCSS 8, and one of my favourites is that it comes with TailwindCSS v3.
You are no longer in need of craco or react-app-rewired to get TailwindCSS work with CRA. All you need is just a few simple steps and let me show you.
npx create-react-app my-app
npx tailwindcss init -p
module.exports = { content: [ ++ "./src/**/*.{js,jsx,ts,tsx}", ], theme: { extend: {}, }, plugins: [], }
@tailwind base; @tailwind components; @tailwind utilities; // Other styles
Voila! Now you can use TailwindCSS in your React app as you like. Feel free to check out the full changelog of Create React App v5. Also worth to mention TailwindCSS new JIT engine is another cool thing to try on too!
Copyright © 2024 Tek Min Ewe