React 7,897 ships two copies of itself. The development copy validates props, checks Hook order, warns about missing keys and keeps the bookkeeping React DevTools 7,897 reads; the production copy strips all of it. In react-dom 19.3.0 the difference is measurable on disk: cjs/react-dom-client.development.js is 1,182,785 bytes, cjs/react-dom-client.production.js is 625,168. Bundlers choose between them by substituting process.env.NODE_ENV at build time and letting minification delete the dead branch — which is why a stray NODE_ENV=development in a deployment script quietly doubles your bundle. Vite 25,978 chooses for you: npm 2,036 run build always emits the production copy.
npm run buildvite v8.3.0 building client environment for production... ✓ 668 modules transformed. dist/index.html 0.32 kB │ gzip: 0.23 kB dist/assets/index-rk4-OIjP.js 603.28 kB │ gzip: 182.70 kB (!) Some chunks are larger than 500 kB after minification. Consider: - Using dynamic import() to code-split the application ✓ built in 274ms
npm run preview then serves dist/ over a local static server — the only honest way to check what you are about to deploy, since the dev server transforms modules on demand and never produces these files.