Overview
The Bİ DOLU İÇECEK application is built using Create React App (react-scripts), which provides an optimized production build with automatic code splitting, minification, and performance optimizations.Build Process
Run the Build Command
Execute the build script from package.json:This command runs
react-scripts build, which:- Compiles React components and JSX
- Bundles JavaScript files
- Processes CSS with PostCSS and Tailwind CSS
- Optimizes images and assets
- Generates production-ready files
Build Output Details
JavaScript Bundles
The build process creates optimized JavaScript bundles:- main.[hash].js - Your application code
- [number].[hash].chunk.js - Code-split chunks for lazy loading
- runtime-main.[hash].js - Webpack runtime logic
File names include content hashes (e.g.,
main.abc123.js) to enable long-term caching. When files change, their hashes change, automatically busting the cache.CSS Files
Tailwind CSS and custom styles are processed and bundled:- Minified and optimized
- Unused styles removed (tree-shaking)
- PostCSS transformations applied
- Autoprefixer for browser compatibility
Asset Optimization
- Images under 10KB are inlined as Data URIs
- Larger images are copied to
build/static/media/ - File names include content hashes for caching
Testing the Build Locally
Serve the Build Directory
Run the server pointing to the build folder:The
-s flag enables single-page application mode, redirecting all requests to index.html.Build Optimization
Production Optimizations
The build process automatically applies:- Code Minification - JavaScript and CSS are minified
- Dead Code Elimination - Unused code is removed
- Code Splitting - Lazy loading for better performance
- Asset Optimization - Images and files are optimized
- Source Maps - Generated for debugging (optional)
Environment Variables
Environment variables are embedded at build time:Only variables starting with
REACT_APP_ are accessible in your code. They are embedded during build time and cannot be changed without rebuilding.Browser Support
The application targets browsers defined inpackage.json:
Production:
- >0.2% market share
- Not dead browsers
- Not Opera Mini
- Last Chrome version
- Last Firefox version
- Last Safari version
Build Performance Tips
Build Troubleshooting
Common Issues
Build Fails with Memory Error:- Ensure PostCSS and Tailwind are properly configured
- Check for CSS import errors in components
- Use relative paths or the
public/folder - Ensure images are imported correctly in components
Next Steps
After building successfully, you’re ready to deploy:- Deployment Options →
- Learn about deploying to Vercel, Netlify, and other platforms