React Build Deploy — Free React Tutorial
Learn React Build Deploy in React with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
TL;DR: Learn React Build Deploy in React with a free, beginner-friendly tutorial, examples and practice for Indian students on Syllab.in.
Written & reviewed by the Syllab.in Academic Team (CBSE/NCERT subject experts) · Updated
React Build Deploy in React
React apps are written in JSX and need to be compiled to regular JavaScript before browsers can run them. Vite is a modern build tool that compiles your code, optimizes it, and bundles it for production. During development, you run `npm run dev` to start a dev server with hot module replacement (changes appear instantly). For deployment, you run `npm run build` to create a optimized `dist` folder containing production-ready files.
Vite is much faster than older tools like Create React App because it uses ES modules and only bundles what's needed. The development server serves your app at `http://localhost:5173` by default. When you make code changes, Vite only recompiles the changed file, making development fast. The build step minifies your code, splits it into chunks, and optimizes assets like images.
To deploy a React app, upload the contents of the `dist` folder to a web host (like Firebase Hosting, Vercel, or Netlify). The dist folder is self-contained and doesn't need Node.js to run — it's just HTML, CSS, and JavaScript. Configure your host to serve `index.html` for all routes so React Router works correctly. Always run `npm run build` locally before deploying to catch errors early.
Learn React Build Deploy step by step with Syllab's free interactive React tutorial — runnable code examples, practice exercises and instant AI feedback, all free with no signup. Explore the full React course →