This site extension minifies html, css, js and potentially (not yet!) images.
On startup of the webapp, the default directory (D:\home\site\wwwroot\) is scanned for .js, .html, .css files. The files are then compressed and replaced. If a file is changed during runtime, they will be reprocessed immediately.
This project was greatly inspired by the existing site extension Azure Image Optimizer by Sayed-Ibrahim-Hashimi and Mads Kristensen and is based on the following libaries:
Zeta Producer Html Compressor, version 1.0.2
A .NET port of Google’s HtmlCompressor library to minify HTML source code.
Efficient stylesheet minification in C#
The method takes a string of CSS and returns a minified version of it. The method have been modified for demo purposes, so you might want to optimize the code yourself.
JSMin.Net, version 1.1.3
JSMin.NET is a .NET port of the Douglas Crockford's JSMin.
tbd
The following can be configured:
Default: D:\home\site\wwwroot
Overwrite them in the app setting of the website.
Default: .css;.html;.js Overwrite them in the app setting of the website.