It doesn't appear that your <asp:ScriptReference />
is outputting the bundle at all. I reference the bundle from a razor template using MVC like this:
@Scripts.Render("~/bundles/lib")
which results in output like this (notice the src
attribute includes the original bundle name):
<script src="/bundles/lib?v=gGKSj7TFmjDTZAjdEzBrqOOu9aGB6i4Tq0mHfaLUk_c1"></script>
If you're not using razor you might try directly referencing the System.Web.Optimization.Scripts class to call the Render()
method and NOT using the <asp:ScriptReference />
.
Regarding minification, you need to add a minification transform to your bundle like this:
var myBundle = new ScriptBundle("~/bundles/MyBundle").Include(
"~/Scripts/WebForms/WebForms.js",
"~/Scripts/WebForms/MSAjax/MicrosoftAjax.js",
"~/Scripts/WebForms/MSAjax/MicrosoftAjaxWebForms.js",
"~/Scripts/WebForms/TreeView.js",
"~/Scripts/WebForms/Focus.js",
"~/Scripts/WebForms/MenuStandards.js")
myBundle.Transforms.Add(new JsMinify());
bundles.Add(myBundle);