What is the difference between dev and production builds?
Dev builds keep readable code, source maps, and hot reload. Production builds minify code, remove development warnings, and optimize for size and speed. Users load less and faster with a production build.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in Deployment and Production React Interview Questions
Run npm run build to create the production bundle, then deploy to a host like Vercel, Netlify, or Firebase Hosting. Set environment variables in the dashboard, and configure SPA routing so deep links work.
Set them in the hosting platform's dashboard, not in committed code. Remember that frontend env vars are visible to users in the browser, so real secrets go in a backend, not in React code.
Because the host serves 404 for routes that are not files. Fix by redirecting all routes to index.html with a rewrite rule, so React Router loads and handles the route client-side.
Still have questions?
Browse all our FAQs or reach out to our support team
