I can successfully include jquery library with ScriptBundle from ASP.NET MVC by using below
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.7.1.js"));
However, If I changed to the minimized library, I could not get it from browser
bundles.Add(new ScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-1.7.1.min.js"));
anything wrong with the code?
Unless EnableOptimizations
is true
or the debug attribute in the compilation Element in the Web.config
file is set to false, files will not be bundled or minified. Additionally, the .min
version of files will not be used, the full debug versions will be selected. EnableOptimizations
overrides the debug attribute in the compilation Element in the Web.config
file
more info
Try clearing ignore list.
public class BundleConfig
{
public static void RegisterBundles(BundleCollection bundles)
{
bundles.IgnoreList.Clear();
// code cleared for clarity
}
}
Everything OK with your code, that's how it works, you can try change ignoreList
.
More details: mvc4 bundler not including .min files
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With