Skip to main content

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

1

Run the Build Command

Execute the build script defined in package.json:
This runs 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
2

Verify Build Output

After a successful build, check the dist/ directory:
You should see:
  • index.html - Main HTML entry point
  • assets/ - Optimized JavaScript, CSS, and other assets
  • vite.svg - Static assets from the public/ directory
  • _redirects - Routing configuration for SPAs

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

From package.json:

Script Descriptions

Build Troubleshooting

If the build fails, check for:
  • ESLint errors (run npm run lint to identify issues)
  • Missing dependencies (run npm install)
  • TypeScript errors if using TypeScript
  • Insufficient memory (try NODE_OPTIONS=--max-old-space-size=4096 npm run build)

Common Issues

Out of Memory Errors
Dependency Issues

Build 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