---
title: Minification
project: Total.js V5
version: 0.0.20
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/total-js-v5/0-0-20/guides/minification/
updated: 2026-11-16T15:48:48.957Z
---

# Minification

> Minify JavaScript, CSS and HTML from your code with the minificators of U.

The framework minifies static `.js`, `.css` and `.html` files and merged files (see [Static files](../static-files/)). The same minificators are in `U`:

```js
U.minify_css('.box {\n\t.title { margin: 0 0 0 0; color: #FFFFFF; }\n}');  // '.box .title{margin:0;color:#FFF}'
U.minify_js('function sum(a, b) {\n\t// adds\n\treturn a + b;\n}');        // 'function sum(a,b){return a+b}'
U.minify_html(html);
```

The CSS minificator also compiles nested rules (a rule that contains only other rules) and variables written as `$name: value;`. `MERGE()` joins several files into one URL and is described in [Static files](../static-files/).

The HTML minificator removes comments (but not conditional comments) and collapses runs of spaces between words. Line breaks and indentation between tags are kept. Inline `<script>` and `<style>` are minified when `$minifyjs` and `$minifycss` are on.
