Why has Vite become more popular than Create React App for starting new React projects?
Short answer
Vite starts a development server almost instantly because it only processes the files a page actually needs right away, instead of bundling the entire app upfront like older tools did.
Advertisement
AModel answer
Vite starts a development server almost instantly because it only processes the files a page actually needs right away, instead of bundling the entire app upfront like older tools did. This means changes show up in the browser in a fraction of a second, which makes the whole development process feel much faster.
// vite.config.js
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
});Real-world example
A large team working on a project with hundreds of components switches from Create React App to Vite and notices the development server now starts in under a second instead of taking almost a minute.
Likely follow-ups
- What made the older bundling approach slower to start compared to Vite?
- How would you migrate an existing Create React App project to Vite?
Related topics