Vite React and Tailwind Setup Script
This script creates a new Vite project with a React template, install the necessary dependencies, set up Tailwind CSS, and perform some optional cleanup tasks.
Prerequisites
Before running the script, make sure you have the following installed:
How to Use
- Open your terminal.
- Navigate to the directory where you want to create your new project.
- Run the script using the command
bash vitet.sh
(replace vitet.sh
with the path to the script if it's not in your current directory).
- When prompted, enter the name of your new project.
What the Script Does
Here's a step-by-step breakdown of what the script does:
- Prompts you to enter a project name.
- Creates a new Vite project with a React template.
- Navigates into the project directory.
- Installs the project dependencies.
- Installs Tailwind CSS, PostCSS, and Autoprefixer.
- Initializes Tailwind CSS.
- Configures Tailwind CSS to scan your classes.
- Imports Tailwind CSS in your CSS.
- Deletes the default
src/assets/react.svg
icon (optional).
- Deletes
src/App.css
(optional).
- Replaces everything from
src/App.jsx
with a simple Tailwind-styled component (optional).
- Runs the project.