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.
lila-minify
With the lila-minify
command you can minify your js and css files
located in the public/js
and public/css
folders.
lila-minify
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:
.png, .jpg, and .jpeg to
.webp using Pillow (quality 80%)..min.css and .min.js files without
destroying your original source code.app/assets_manifest.json dictionary.
lila-optimize
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!
If you are working in a modern frontend environment with Node.js and npm installed, Lila includes built-in support for a Vite + Tailwind CSS v4 pipeline which replaces the need for lila-minify or lila-optimize:
npm run dev to boot both the Vite dev server and the Python uvicorn server in parallel, providing full Hot Module Replacement (HMR) for CSS and JS assets in real-time.npm run build to compile, bundle, and generate cached hashed files (e.g. utils-CnU24iax.js) via Vite's native manifest.json. Lila resolves these hashed files automatically in production.public/ folder, ensuring your project always runs out-of-the-box.