Minification
Automatic HTML minification powered by Cloudflare's Rust-based minifier.
Enable minification
Minification is enabled by default. You can explicitly control it in tulip.toml:
[minify]
enabled = trueHow it works
tulip uses the minify-html crate, Cloudflare's high-performance Rust minifier. When enabled, every HTML file in the output directory is minified after all other build steps have completed.
What gets minified
- HTML — whitespace is collapsed, comments are removed, and redundant attributes are stripped
- Inline CSS — CSS inside
<style>tags is minified - Inline JS — JavaScript inside
<script>tags is minified
Build order
Minification runs as the final step in the build pipeline:
- Templates are rendered
- Markdown content is processed
- Plugins run their hooks
- Tailwind CSS is generated (if enabled)
- HTML minification runs
Example
Before minification:
<div class="container">
<h1>Hello World</h1>
<!-- welcome message -->
<p>Welcome to my site.</p>
</div>After minification:
<div class=container><h1>Hello World</h1><p>Welcome to my site.</div>