Code minification is the process of removing unnecessary characters from a section of code while leaving the code's original functionality in tact. The end result is a new file which is smaller in size to the original, yet identical from the machine's perspective. Smaller files require less bandwidth, and have shorter load times on the web. This can reduce server resources and lead to a more pleasant user experience which is why minifing files is often cited as a best practice for web developement.
*The articles linked to describe an earlier version of this minifier, one with slightly less capabilities.
Minification may seem straight forward, but is desepetively complex. While there are many simple approaches (like condensing white space) that can have a big impact on code size, perfect minification would require the ability to understand code from a functional level, and predict all possible outputs from all possible inputs. In fact, it is mathematically provable that a program to achieve perfect minification cannot exist by reducing it to the Halting Program.
Assumptions the Minifier makes while Minifying HTML: