Skip to main content

Production

Preparing for Production

To ensure speed during development, all code optimization is performed during the build process in preparation for deployment online. Before deploying to Staging or Production environments, always execute:

yarn build

Note: Your local server (Mamp, DDEV, Valet, etc.) must be running during the build process.

What the build process does:

  • Appends a hash to the compiled files for cache busting purposes.
  • Minifies and chunks the project code, separating vendors into distinct files for optimized loading.
  • Implements tree-shaking to remove any unused code, ensuring the smallest possible bundle size.
  • Compiles JavaScript according to Babel configurations, for broad browser compatibility.
  • Processes Tailwind CSS for production by applying purge and minification steps, stripping out any unused styles to deliver a lean, optimized stylesheet.
  • Cleans the web/dist directory before populating it with the new compiled files.

This comprehensive build process is designed to optimize your project for the best performance in production. It's a critical step that enhances user experience by ensuring that your site loads quickly and efficiently, with minimal bandwidth usage.