DEV Community


Discussion on: Purging TailwindCSS without ejecting Create-React-App

ivanbtrujillo profile image
ɪᴠᴀɴ • Edited

Hi @jmhungdev . Good article.

One thing you can do is instead of replace the build script by prod:build, you can use prebuild to build tailwind. That will keep build script as the normal way to build the application:

    "build:tailwind": "tailwindcss build src/tailwind/tailwind.css -o src/tailwind/tailwind.output.css",
    "start": "react-scripts start",
    "prebuild": "NODE_ENV=production npm run build:tailwind",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
Enter fullscreen mode Exit fullscreen mode