WorknHardr
asked on
.NET MVC5 Bundle Config Layout?
I'm trying to layout our new MVC5 bundles to separate scripts accordingly. I say "Why load more scripts in the Layout page then necessary?" Anyway, here's my layout so far.
Q. Does this look correct?
public static void RegisterBundles(BundleColl ection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/jq uery").Inc lude(
"~/Scripts/jquery-{version }.js"));
bundles.Add(new ScriptBundle("~/bundles/jq ueryval"). Include(
"~/Scripts/jquery.unobtrus ive*",
"~/Scripts/jquery.validate *",
"~/Scripts/jquery.validate .unobtrusi ve.js"));
bundles.Add(new ScriptBundle("~/bundles/jq uery-ajax" ).Include(
"~/Scripts/jquery.unobtrus ive-ajax.j s"));
bundles.Add(new ScriptBundle("~/bundles/jq uery-ui"). Include(
"~/Scripts/jquery-ui-1.11. 0.js"));
Q. Does this look correct?
public static void RegisterBundles(BundleColl
{
bundles.Add(new ScriptBundle("~/bundles/jq
"~/Scripts/jquery-{version
bundles.Add(new ScriptBundle("~/bundles/jq
"~/Scripts/jquery.unobtrus
"~/Scripts/jquery.validate
"~/Scripts/jquery.validate
bundles.Add(new ScriptBundle("~/bundles/jq
"~/Scripts/jquery.unobtrus
bundles.Add(new ScriptBundle("~/bundles/jq
"~/Scripts/jquery-ui-1.11.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Off Topic:
No more points for questions at EE?
No more points for questions at EE?
They default to 500 now. The multiplier (that you add if you grade as "A" , "B", "C") still apply, though. EE changed this a week or so ago.
Also, I would say you bundle together everything that would make sense to go together in order to make some piece of functionality (or styling) work if you add the bundle to a page. For instance, you might be using JQuery UI for some visual components. But JQuery UI depends on JQuery, so you might bundle the two together into one bundle. In this way, you ensure whichever page that receives the bundle will have both libraries available to it.
ASKER