reactjstailwind-cssvitetailwind-css-3

Is there a terminal command that installs both react + tailwindcss using vite


I want to install both tailwind + react with one command. Creating empty template files (copy pasting an empty tailwind installed project) makes my file system weird.

I searched for it and actually find nothing helpful. There is a create-vite-tailwind package but not working for me till it's pure html & javascript.


Solution

  • These commands should get you started with a Vite + TailwindCSS boilerplate

    NPM

    npm init vite@latest my-react-tailwind-project -- --template react
    cd my-react-tailwind-project
    npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
    npx tailwindcss init -p
    

    Yarn

    yarn create vite@latest my-react-tailwind-project -- --template react
    cd my-react-tailwind-project
    yarn add -D tailwindcss@latest postcss@latest autoprefixer@latest
    npx tailwindcss init -p
    

    "my-react-tailwind-project" can be changed to whatever project name you choose.

    You can continue with the rest of your configurations from there.