Why Use Build Tools in React? What Do Vite and CRA Do?

Aditya rajAditya raj
1 min read
  1. When writing vanilla JS or C++ we don’t need any build tools or bundlers because browser (for JS ) and compilers (for C++) directly understand and execute the code.

  2. We could write React code without using Vite, CRA or similar tools, but it would require a lot of manual work i.e

    • we need to set up Babel to transpile JSX and ES6+ syntax into browser compatible JS code.

    • Need to configure webpack or Rollup to bundle your files together

    • Have to Handling hot module reloading (HMR), CSS imports, environment variables, and more

  3. Tools like Vite or CRA acts as a bridge between moder react features (JSX, modular components, ES6+ syntax) and the browser’s ability to execute code.

  4. They save us from the hassle of manual configuration while providing a development-friendly environment.

0
Subscribe to my newsletter

Read articles from Aditya raj directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Aditya raj
Aditya raj

Aspiring full-stack developer with a passion for building impactful digital products. Seeking opportunities to apply and grow my skills in a collaborative tech environment.