Friday, January 29, 2010

An introduction to ASP.NET Ajax 4: The Minifier

The Minifier is an utility which "minifies" your scripts: it reduces the size of your scripts by removing comments, removing spaces, renaming local variables and removing unreachable code.

You can download the Minifier on Codeplex.

Before and after

The unminified script looks like this.

   1:  //This function does something
   2:  function doSomething(valueOne, valueTwo){
   3:      var result = valueOne + valueTwo;
   4:      return result;
   5:  }

After hypercrunching the script looks likes this.

   1:  function doSomething(a,b){var c=a+b;return c}

No comments:

Post a Comment