ASP.NET Bundles how to disable minification
Conditional compilation directives are your friend:
#if DEBUG
var jsBundle = new Bundle("~/Scripts/js");
#else
var jsBundle = new ScriptBundle("~/Scripts/js");
#endif
If you have debug="true"
in web.config and are using Scripts/Styles.Render
to reference the bundles in your pages, that should turn off both bundling and minification. BundleTable.EnableOptimizations = false
will always turn off both bundling and minification as well (irrespective of the debug true/false flag).
Are you perhaps not using the Scripts/Styles.Render
helpers? If you are directly rendering references to the bundle via BundleTable.Bundles.ResolveBundleUrl()
you will always get the minified/bundled content.