Project Description

BundlingTweaks plugs into the Bundling/Minification pipeline in ASP.NET MVC 4 Beta and tries to find non-minimized JS and CSS files while bundling so you can see the actual, non-minified, JavaScript and CSS you wrote in the first place.

This only happens during debugging (using an #if DEBUG in the startup code), so you don't have to worry about compromising your release code's minification.

BundlingTweaks tries 2 things to find replacements for any ".js/.css"file:
  • Remove ".min"
  • Add ".debug"
(e.g. "Foo.min.css" => "Foo.css", "Bar.js" => "Bar.debug.js")

Customization

If you so desire, you can add other custom replacements, like ".release" -> ".debug" by adding them to a static dictionary:

TweakSettings.ExtensionReplacements.Add(".minified", string.Empty);
TweakSettings.ExtensionReplacements.Add(string.Empty, ".pretty");
TweakSettings.ExtensionReplacements.Add(".release, ".debug");

Debugging

You can also enable Trace output like this:
TweakSettings.EnableTraceOutput = true;

Output:

iisexpress.exe Information: 0 : Using Original File for site.css
iisexpress.exe Information: 0 : Using Original File for jquery.ui.core.css
iisexpress.exe Information: 0 : Using Original File for jquery.ui.resizable.css
iisexpress.exe Information: 0 : Using Original File for jquery.ui.selectable.css
...
iisexpress.exe Information: 0 : Replacing bootstrap-responsive.min.css with bootstrap-responsive.css
iisexpress.exe Information: 0 : Replacing bootstrap.min.css with bootstrap.css
iisexpress.exe Information: 0 : Replacing jquery-1.7.1.min.js with jquery-1.7.1.js
iisexpress.exe Information: 0 : Replacing jquery-ui-1.8.18.min.js with jquery-ui-1.8.18.js
iisexpress.exe Information: 0 : Replacing jquery.unobtrusive-ajax.min.js with jquery.unobtrusive-ajax.js

Please hit the issue tracker if you run into problems.

Last edited Mar 17, 2012 at 7:37 PM by tommck, version 2