This script automates the setup of a new React project using Vite, along with optional installations of various libraries. It also configures ESLint and Vite for your project.
Ensure you have the following installed:
Clone this repository:
git clone https://github.com/your-username/your-repository.git
cd your-repository
Make the script executable (on Unix-based systems):
chmod +x create-react-vite-project.js
Run the script:
node create-react-vite-project.js
Follow the prompts to set up your project.
The script will first prompt you for:
Based on your responses:
.eslintrc.cjs
vite.config.js
App.jsx
, index.css
).Here is how the script will execute:
Enter the name of your project: my-react-app
Install Tailwind CSS? (y/n): y
Install Framer Motion? (y/n): n
Install GSAP? (y/n): y
Install React Query? (y/n): y
...
Dependency Conflicts: If you encounter dependency conflicts, you may need to use the --legacy-peer-deps
option with npm commands.
File Permissions: Ensure the script has execute permissions (on Unix-based systems) using chmod +x create-react-vite-project.js
.
Feel free to submit issues or pull requests to improve the script.