DEV Community

bart
bart

Posted on

Creating React App Using Vite

I recently found out that create-react-app was no longer being supported which forced me to try other methods of creating a react app. I was so disappointed when I came to learn of the use of Vite because of how easy and fast it was to create a react app. Another of it's pros is that it's not a react-specific tool so you have the flexibility and can use it in creating other frameworks like Vue.

  1. To start using vite, you navigate to your project directory, and run this:
npm create vite@latest
Enter fullscreen mode Exit fullscreen mode
  1. Choose the project name which will also be the project's folder name.
  2. Choose a framework, then select your preferred variant whereby you can optionally add swc.
  3. Navigate to the project folder and cd into it.
cd vitetest
Enter fullscreen mode Exit fullscreen mode
  1. Run the project
npm run
Enter fullscreen mode Exit fullscreen mode
  1. Install the dependencies by running
npm install
Enter fullscreen mode Exit fullscreen mode
  1. Run the app using
npm run dev
Enter fullscreen mode Exit fullscreen mode

and voila, your app should be running on port http:/localhost/5173.

Latest comments (0)