Skip to content
This repository has been archived by the owner on Nov 23, 2018. It is now read-only.

This site extension minifies html, css, js and images (jpg, gif, png).

License

Notifications You must be signed in to change notification settings

MaxMelcher/AzureExtension.FullMinify

Repository files navigation

Azure Site Extension: FullMinifier

This site extension minifies html, css, js and images.

On startup of the webapp, the default directory (D:\home\site\wwwroot\) is scanned for .js, .html, .css,.jpeg,.png and .gif 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:

Html Minifier

Zeta Producer Html Compressor, version 1.0.2

A .NET port of Google’s HtmlCompressor library to minify HTML source code.

CSS Minifier

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.

JS Minifier

JSMin.Net, version 1.1.3

JSMin.NET is a .NET port of the Douglas Crockford's JSMin.

Image Minifier

The image minifier is based on a couple of tools that Mads Kristensen picked:

  • gifsicle.exe to minify gifs
  • jpegtran.exe to minify jpgs
  • zopflipng.exe to minify pngs

Currently the images are lossy compressed to get the best results. A configuration flag will follow.

Setup

Install this extension in the kudu site: https://.scm.azurewebsites.net/SiteExtensions/#gallery (replace with the name of your site!) Search for AzureExtension.FullMinifier Install it Then open the site https://.scm.azurewebsites.net/SiteExtensions/AzureExtension.FullMinifier

Configuration

The following can be configured:

The directory that will be scanned for files: minify.path

Default: D:\home\site\wwwroot
Overwrite them in the app setting of the website.

The file extensions of the files that will be minified: minify.extensions

Default: .css;.html;.js Overwrite them in the app setting of the website.

About

This site extension minifies html, css, js and images (jpg, gif, png).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages