pythonreactjstailwind-cssnpm-run

Tailwindcss Not Updating In Browser after Class Change


I'm running Tailwind with React but in order for me to see changes that I make to classNames I have to restart the server and run npm run start again to see the updates.

Is there something I need to change in my scripts so that the browser updates without having to restart the server.

package.json '''

"scripts": {
    "start": "npm run watch:css && react-scripts start",
    "build": "npm run watch:css && react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "watch:css": "postcss src/assets/tailwind.css -o src/assets/main.css"
  }

'''

All feedback is appreciated! Thanks


Solution

  • && will run command one after another, so try to use this npm-run-all library to run npm command on parallel