If you have used Create React App, you know the pain: starting a dev server takes a while, and every change waits for a rebuild. Vite fixes that by doing less work. During development it serves your code as native ES modules, straight to the browser, with no bundling step at all. The result is a dev server that starts in under a second and updates instantly when you save.
Getting started takes one command:
npm create vite@latest my-app -- --template react cd my-app npm install npm run dev
Enter fullscreen mode
Exit fullscreen mode
Open the URL it prints, change a line of code, and watch the page update without a refresh. That is Hot Module Replacement, and in Vite it is fast because only the file you changed is re-processed β not the whole app. The same goes for the production build: when you run npm run build , Vite uses Rollup to bundle everything into optimised files, so you get fast development and a fast production build from one tool.
Vite is not tied to React.β¦