I’m trying to find a way to install Tailwind on an existing React app. Everything I’m finding has them concurrently installed npx in the terminal. Any help would be appreciated.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (3)
I did for a new ReactJS here: dev.to/codeprototype/accelerating-...
but since your question is for an existing app, you might want to try the following:
npm i --save tailwindcss tailwindcss-tables
//tailwindcss-tables if you want tableIn your
styles.css
, add 3 lineswebpack.config.js
then
Since
MiniCssExtractPlugin
andpostcss-loader
are required, install them:npm i --save-dev mini-css-extract-plugin postcss-loader
Create a new
npx tailwind.config.js
by running the command (generates default)npx tailwind init tailwind.config.js
Create a config file for postcss called
postcss.config.js
touch postcss.config.js
gist.githubusercontent.com/khle/cc...
If you need
@fullhuman/postcss-purgecss
, then install it as well (I think you needpostcss-import
also).npm i --save-dev @fullhuman/postcss-purgecss postcss-import
Else, you can remove those lines in the
postcss.config.js
.I think that's all the steps. Please refer to my post if necessary
I found this, How to add Tailwind to unejected Create-React-App yesterday. KCD used a macro to add Tailwind to CRA.
Not sure how your React site bootstrapped but won't hurt to check it out.
It’s part of a group project that I don’t have admin access to. I can toss together a quick clone on my GitHub and send you a collaborator invite.