Configure Microsoft AJAX Minifiers

(see: http://aspnet.codeplex.com/releases/view/40584)

The configuration below directly maps to the configuration options provided by the underlying Microsoft AJAX Minifiers. Xpedite does not implement any special logic around the base minifiers and any minification issues are that of the Microsoft AJAX Minifier library.

To start using custom Xpedite configuration for Microsoft AJAX Minifier:
  1. Complete initial Xpedite configuration (see: Configure Partially Xpedited Web Site).
  2. Register the Xpedite Microsoft AJAX Minifier custom configuration section in the web site's web.config file.
  3. Confiure Microsoft AJAX Minifier with the desired minifier options.

Completing Xpedite Configuration

Complete initial Xpedite configuration (see: Configure Partially Xpedited Web Site).

<xpedite mode="RemoteOnly">
  <css minifier="Xpedite.Minification.MsAjaxMinifier.MsAjaxCssMinifier, 
                 Xpedite.Minification.MsAjaxMinifier, 
                 PublicKeyToken=469a6014a0d38b85" />
  <javascript minifier="Xpedite.Minification.MsAjaxMinifier.MsAjaxJavaScriptMinifier, 
                 Xpedite.Minification.MsAjaxMinifier, 
                 PublicKeyToken=469a6014a0d38b85" />
</xpedite>

Registering the Xpedite Microsoft AJAX Minifier custom configuration section

Within the <configuration> element of the web site's web.config file, add the following XML block to register the Xpedite custom configuration section.

<configuration>
  <!-- Other XML -->
  <configSections>
    <section name="xpedite.msAjaxMinifier" 
             type="Xpedite.Minification.MsAjaxMinifier.Config.ConfigSectionHandler, 
                   Xpedite.Minification.MsAjaxMinifier, PublicKeyToken=469a6014a0d38b85" 
             requirePermission="false"/>
  </configSections>
  <!-- Other XML -->
</configuration>

Once the custom configuration section has been registered in the web.config, the Xpedite Microsoft AJAX Minifier configuration section may then be added.

CSS (Optional)
<configuration>
  <!-- Other XML -->
  <xpedite.msAjaxMinifier>
    <css colorNames="Strict"
         commentMode="None"
         expandOutput="false"
         indentSpaces="4"
         severity="1"
         termSemicolons="false"
      />
  </xpedite.msAjaxMinifier>
  <!-- Other XML -->
</configuration>

Note: Sample XML configuration illustrates the default configuration options used by the CSS Microsoft AJAX Minifier.

JavaScript (Optional)
<configuration>
  <!-- Other XML -->
  <xpedite.msAjaxMinifier>
    <javascript collapseToLiteral="true"
                combineDuplicateLiterals="false"
                evalTreatment="Ignore"
                indentSize="4"
                inlineSafeStrings="true"
                localRenaming="CrunchAll"
                macSafariQuirks="true"
                minifyCode="true"
                outputMode="SingleLine"
                preserveFunctionNames="false"
                removeFunctionExpressionNames="true"
                removeUnneededCode="true"
                stripDebugStatements="true"
    />
  </xpedite.msAjaxMinifier>
  <!-- Other XML -->
</configuration>

Note: Sample XML configuration illustrates the default configuration options used by the JavaScript Microsoft AJAX Minifier.

Last edited Jan 15, 2011 at 8:38 PM by CBaxter, version 7

Comments

No comments yet.