This project has moved. For the latest updates, please go here.

Use minifier other than default

Jun 4, 2014 at 6:39 PM
Edited Jun 4, 2014 at 6:49 PM
Is it possible to
  1. Use a minifier other than the one specified in web.config as the default?
  2. Turn minification off for a single bundle?
Jun 4, 2014 at 6:49 PM
Edited Jun 4, 2014 at 8:09 PM
  1. yes
var jsNullTransformer = new JsTransformer();
var jsMsAjaxTransformer = new JsTransformer(new MicrosoftAjaxJsMinifier());
2 by extension of the former, yes
Marked as answer by willeyams on 6/4/2014 at 1:09 PM
Jun 5, 2014 at 8:08 AM
Hello, Willeyams!

Instances of CssTransformer and JsTransformer classes, created without parameters, use minifier, that specified in Web.config file.
var cssTransformer = new CssTransformer();
var jsTransformer = new JsTransformer();
To disable minification the need to pass in transformer's constructors instance of NullMinifier class:
var nullMinifier = new NullMinifier();

var cssTransformer = new CssTransformer(nullMinifier);
var jsTransformer = new JsTransformer(nullMinifier);