ASP.Net MVC Bundles and Minification -
when moving development production environment have run problems way in javascript files beingness minified. seems not minify properly, , have been looking around find way not minify specific bundle.
public static void registerbundles(bundlecollection _bundles) { _bundles.add(new scriptbundle("~/bundles/tonotminify").include( "~/scripts/xxxxxx.js" )); _bundles.add(new scriptbundle("~/bundles/tominify").include( "~/scripts/yyyyy.js" )); etc..
this basic layout in bundle config class. want find way in have of bundles minified, apart first one. possible? far solution have found accomplish similar turn off minification globally.
you have couple of options, can either replace utilize of scriptbundle
bundle
in example:
_bundles.add(new bundle("~/bundles/tonotminify").include( "~/scripts/xxxxxx.js" ));
.. or disable transformations on newly created bundle, so:
var nominify = new scriptbundle("~/bundles/tonotminify").include( "~/scripts/xxxxxx.js" ); nominify.transforms.clear(); _bundles.add(nominify);
obviously first solution much prettier :)
asp.net-mvc asp.net-mvc-4
No comments:
Post a Comment