Build Process
Tienda ETCA uses Vite for building the production-ready application. The build process optimizes your code for performance and creates static assets ready for deployment.Production Build
Run the Build Command
Execute the build script defined in This runs
package.json:vite build which:- Bundles all JavaScript and CSS files
- Minifies and optimizes code
- Processes and optimizes assets
- Generates source maps
- Creates a production-ready
dist/directory
Build Output Structure
Vite automatically adds content hashes to filenames (e.g.,
index-abc123.js) to enable efficient browser caching and cache busting.Build Optimization
Vite automatically applies several optimizations:Code Splitting
Vite intelligently splits your code into smaller chunks for faster loading:- Vendor dependencies are separated from application code
- Dynamic imports create separate chunks
- React Router routes can be lazy-loaded
Tree Shaking
Unused code is automatically removed from the final bundle, reducing file size.Asset Optimization
- Images and fonts are optimized
- CSS is minified and purged of unused styles
- JavaScript is minified using esbuild
Available Scripts
Frompackage.json:
Script Descriptions
| Script | Command | Purpose |
|---|---|---|
dev | npm run dev | Start development server with hot reload |
build | npm run build | Create production build |
lint | npm run lint | Run ESLint to check code quality |
preview | npm run preview | Preview production build locally |
Build Troubleshooting
Common Issues
Out of Memory ErrorsBuild Performance
Typical build times for Tienda ETCA:- Initial build: 10-30 seconds
- Subsequent builds: 5-15 seconds
Build times depend on your hardware, the number of dependencies, and the size of your application.
Next Steps
After successfully building your application:- Deploy to a hosting platform
- Set up continuous deployment with Git integration
- Configure custom domains and SSL certificates