Careeroza
Create a Project with Vite
Create the App
Vite is the recommended way to start a plain React app: it starts instantly and reloads on save.
Example
Create a project called my-app, install dependencies and start the dev server:
npm create vite@latest my-app -- --template react
cd my-app
npm install
npm run devExample output
VITE v6.0.0 ready in 300 ms ➜ Local: http://localhost:5173/ ➜ press h + enter to show help
Note: Use the react-ts template instead of react for TypeScript.
Useful Commands
| Command | What it does |
|---|---|
| npm run dev | start the development server with hot reload |
| npm run build | create an optimised production build in dist/ |
| npm run preview | serve the production build locally to test it |
| npm run lint | check the code with ESLint |
| npm install axios | add a library to the project |