React Tailwind - Not able to run build.css file

364 Views Asked by At

I am new to tailwind I have a simple react shopping cart project with basic CSS and I want to convert it with Tailwind.

I have install tailwind using the tutorial below.

https://www.youtube.com/watch?v=v6Sy6VP2yOc

But I am stuck when in tutorial he use npm run build:css command.

Video Time lap -- https://youtu.be/v6Sy6VP2yOc?t=286

In tutorial it compile successfully but on my side it did not.

Can anybody tell me why?

1

There are 1 best solutions below

0
On

Can you please check the below code? Hope it will work for you. You can try this way, it might be helpful for you.

"scripts": {
  "start": "react-scripts start",
  "build": "npm run build:css && react-scripts build",
  "test": "react-scripts test",
  "eject": "react-scripts eject",
  "build:css": "postcss src/your-path -o src/your-path",
}

After that, you need to restart your project using the below command so that this will build your tailwind file automatically.

npm start