You Should Choose Vite Over CRA for React Apps, Here’s Why

Can Durmus
CodeX
Published in
6 min readJul 7, 2021

--

cra to vite

For many beginners, intermediate and even for some expert programmers, Create React App is the key tool to start and maintain a React project because it provides many useful features such as HMR (Hot Module Replacement) and development server. However, it has a big drawback which is poor performance.

For almost two years, I used CRA for my React applications and I was happy because there were no configuration files and the build times were not a big deal for me because I was working on simple projects that contains 5,000 to 10,000 lines of code. However, when I tried to build something massive, like 25,000 lines of code, I started to get tired of waiting because when I started my project, the development server was getting ready in almost 5 minutes, and whenever I made a change in my code, I had to wait for almost 5 to 10 seconds to see the effects. These times are pretty huge when you are working a real-life project. I knew that it was not about my computer but CRA. That’s when I searched for some alternatives for CRA and found Vite.

Under the hood, CRA uses Webpack which is a popular asset bundler that helps us develop and build a web app. The Webpack was fine until 2–3 years ago but today, we have almighty Esbuild.

--

--

Can Durmus
CodeX
Writer for

Hi, I am Can. I have been working on web development for a while. I am currently an EEE student at Koc University. I like creating music, as well.