Reputation: 4030
I am getting a strange result when trying to use @Scripts.Render()
on one of my pages.
the bundle config for the jquery bundle is this:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-1.9.1.min.js",
"~/Scripts/jquery-ui-1.10.3.min.js"));
which is then called in the view like so:
@Scripts.Render("~/bundles/jquery")
it has no problems generating the links to raphaeljs, or my system.js file. but its just not rendering jquery at all.
The result when ran is this:
<link href="/Content/System.css" rel="stylesheet"/>
<link href="/Content/jquery.qtip.css" rel="stylesheet"/>
<script src="/Scripts/system.js"></script>
<!--qtip-->
<script src="/Scripts/jquery.qtip.js"></script>
<!--Jquery-->
<!--Raphaeljs-->
<script src="/Scripts/raphael-min.js"></script>
Upvotes: 0
Views: 811
Reputation: 3327
There are two possible solutions to this. I faced exactly the same problem in my previous project.
FIRST TRY: This is my best shot. This tells the helper to ignore .min.js while debugging. Some plugins on your DOM might already have been minified. Asking the helper to minify it causes a mess in its logic.
BundleTable.Bundles.IgnoreList.Clear(); // apparently, IgnoreList included .min.js in debug
BundleTable.Bundles.IgnoreList.Ignore(".intellisense.js", OptimizationMode.Always);
BundleTable.Bundles.IgnoreList.Ignore("-vsdoc.js", OptimizationMode.Always);
BundleTable.Bundles.IgnoreList.Ignore(".debug.js", OptimizationMode.Always);
Its a bundling settings. So put the code first before other bundle codes.
SECOND TRY: Update the ASP.NET WEB OPTIMISATION HELPER to the pre-release version via nuget package manager
PM> Install-Package Microsoft.AspNet.Web.Optimization -Pre
I suggest you try the first option before the second. Pre-release might have the same issue later in the future. thats for sure. Because its pre-release
Upvotes: 2