i implementing bundling , minification in mvc4 not working when deploy on iis server. used below code in bundleconfig.cs
public static void registerbundles(bundlecollection bundles) { bundles.add(new stylebundle("~/content/styles/sitecss").include("~/content/styles/reset.css")); bundles.add(new scriptbundle("~/sitejscommon").include("~/scripts/html5.js", "~/scripts/jquery.js", "~/scripts/jquery-migrate-1.1.1.js", "~/scripts/jquery-ui-1.10.3.custom.js", "~/scripts/carousel.js", "~/scripts/template.js", "~/scripts/jquery.validate.js", "~/scripts/additional-methods.js", "~/scripts/function.js")); bundletable.enableoptimizations = true; }
even checked in web.config. seems fine.
<compilation debug="false" targetframework="4.5" />
can tell me doing mistake. possible enable bundle only?
thanks ashu
there built-in no configs/options allow enable bundling without minification.
however, bundles (script or style) use ibundletransform
: microsoft.web.optimisation include 2 defaults transform type jsminify , cssminify used scriptbundle , stylebundle respectively. can create our own custom transform type process references per our need or better not use ibundletransform
.
so, enable bundling without minification try :
//somewhere after bundles registered foreach (var bundle in bundles) { bundle.transforms.clear(); }
Comments
Post a Comment