On one of our pages we have an ungodly amount of jquery shoved into one script tag. I'm trying to clean things up a bit by separating the code into a few individual .js files and using an ASP MVC 4 ScriptBundle
.
However, Chrome shows only one script is loading, and that script has a weird name that looks somewhat like a GUID.
If I select this script, I can see that only the first .js file in the bundle loaded. The second file completely missing.
BundleConfig
public class BundleConfig
{
// For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Add(new ScriptBundle("~/bundles/AgentTransmission").Include(
"~/Scripts/AgentTransmission/SetFields.js",
"~/Scripts/AgentTransmission/MarketingDivision.js"));
.
.
}
}
Screen shot of the Scripts folders
.cshtml Create file (View)
@model MonetModelFromDb.Models.AgentTransmission
@{
ViewBag.Title = "Create new Agent";
}
<div>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<script src="@Url.Content("~/Scripts/jquery.maskedinput-1.3.1.js")" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment-with-locales.min.js"></script>
@Scripts.Render("~/bundles/AgentTransmission")
Rendered HTML
<div>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<script src="/Scripts/jquery.maskedinput-1.3.1.js" type="text/javascript"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment-with-locales.min.js"></script>
<script src="/bundles/AgentTransmission?v=2D1TPLuuUcxrXmQ8AbdEoyTUVF8BEXja9e0nXKAzs9Q1"></script>
EDIT
FYI I'm also running in DEBUG mode