ASP.NET ScriptBundle not working with .min.js?

I can successfully enable jquery library with ScriptBundle from ASP.NET MVC using below

bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.7.1.js")); 

However, if I switched to the minimized library, I could not get it from the browser

 bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.7.1.min.js")); 

Is there something wrong with the code?

+8
javascript asp.net-mvc bundle
source share
3 answers

If EnableOptimizations not true or the debug attribute in the compilation element. The Web.config element is set to false, the files will not be bundled or reduced. In addition, the .min version .min not be used; full debug versions will be selected. EnableOptimizations overrides the debug attribute in the compilation element in the Web.config file

more details

+14
source share

Try to clear the ignore list.

 public class BundleConfig { public static void RegisterBundles(BundleCollection bundles) { bundles.IgnoreList.Clear(); // code cleared for clarity } } 
+9
source share

Everything is fine with your code, how it works, you can try changing ignoreList .

More details: mvc4 bundler, not including .min files

+3
source share

All Articles