Why Minify HTML?
The biggest reason is to strip comments from an HTML file before deploying it.
Stripping comments and extra whitespace from a file can also reduce its size, which means faster page loads—especially on cellular networks.
CodeKit uses HTML-Minifier to shrink HTML files.
All Files At Once
You can enable the minifier for all files of a given type at once by opening Project Settings and choosing a language.
Warning: Valid Syntax Required
The minifier will fail to run on files that are not HTML or that have syntax errors. In these cases, it may also produce invalid or incorrect output. If that happens, check your original file for syntax issues.
Note: You can use HTML-Minifier on files that are not strict HTML (Kit, Pug, Slim, Markdown, etc.) because CodeKit will first compile the file to HTML and then run the minifier.
Currently, no options are exposed for HTML-Minifier. It will strip comments, delete insignificant whitespace, and remove duplicate/unneeded attributes.
Tip: to keep a comment, use !:
<!--! YOU SHALL NOT PASS -->
The reason more configuration options are not exposed is that they tend to break your HTML. With the defaults, you get all the biggest optimizations without any risk of broken files.