Photo by Harley-Davidson on Unsplash
Vite is a build tool for web applications. It requires Node.js and npm to be installed in your machine.
Getting started quickly
Go to the terminal [you can get it in VS Code by clicking the 3 dots beside View, going to Terminal and clicking ‘New Terminal’] and type the following :
npm create vite@^4.0.0 --save-dev
It will ask the following questions :
- Project name
- Framework used [select React]
- Variant [select JavaScript]
A folder with the project name is created. Then it gives you a bunch of commands that you should run.
If the project name is sample…
cd sample
npm install
npm install @vitejs/plugin-react@^4.0.0 --save-dev
npm run dev
Since Vite v6 is insanely unstable at the point of writing, I’m using v4.