Minify Files for Production

With the lila-minify command you can minify your js and css files located in the public/js and public/css folders.

Terminal Command

lila-minify

Asset Optimizer (lila-optimize)

For maximum Lighthouse scores and zero-CPU overhead in production, use the lila-optimize command.

Unlike lila-minify which overwrites files, lila-optimize acts as an Ahead-of-Time asset builder:

  • Images: Converts .png, .jpg, and .jpeg to .webp using Pillow (quality 80%).
  • CSS/JS: Generates parallel .min.css and .min.js files without destroying your original source code.
  • Manifest: Generates an app/assets_manifest.json dictionary.
Terminal Command

lila-optimize

Silent Magic (Templates)

When DEBUG=False, Lila automatically loads the manifest into RAM. The {{ '{{' }} public('img/logo.png') {{ '}}' }} Jinja helper performs a fast dictionary lookup. If a .webp or .min.js version exists in the manifest, it will automatically serve it instead of the original file, saving you from rewriting your HTML!