Setting Up a React Project with Vite

Setting Up a React Project with Vite

Source: Dev.to

Why Set Up a React Project? ## Setting Up React with Vite ## Steps to Create a React App with Vite ## Vite For React needs a build tool to manage dependencies, compile JSX, and optimize performance. The two most popular ways to set up a React project are: Vite is a modern build tool that offers: 1. Open Terminal & Run: 2. Navigate to the project folder: 3. Install dependencies: 4. Start the development server: Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK: npm create vite@latest my-app --template react Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: npm create vite@latest my-app --template react COMMAND_BLOCK: npm create vite@latest my-app --template react CODE_BLOCK: yarn create vite@latest my-app --template react Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: yarn create vite@latest my-app --template react CODE_BLOCK: yarn create vite@latest my-app --template react CODE_BLOCK: pnpm create vite@latest my-app --template react Enter fullscreen mode Exit fullscreen mode CODE_BLOCK: pnpm create vite@latest my-app --template react CODE_BLOCK: pnpm create vite@latest my-app --template react CODE_BLOCK: cd my-app Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: npm install Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: npm install COMMAND_BLOCK: npm install COMMAND_BLOCK: npm run dev Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK: npm run dev COMMAND_BLOCK: npm run dev - Create React App (CRA) – Official but slower and its now Sunset - Vite – Faster, modern alternative - Faster development server. - Better performance with ES modules. - Optimized production build.