0

So, for scripts/styling bundles I have:

@Scripts.Render("~/bundles/jquery")    
@Styles.Render("~/Content/css")

The bundle config is pretty basic:

bundles.UseCdn = true;

bundles.Add(new StyleBundle("~/Content/css").Include(
    "~/Content/css/icomoon.css",
    "~/Content/bootstrap.css",
    "~/Content/bootstrap-theme.css",
    "~/Content/toastr.css",
    "~/Content/custom.css"));

bundles.Add(new ScriptBundle("~/bundles/jquery", "//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"));

The local bundle works, but the CDN bundle does not. Debug vs. release mode seems to make no difference: in either case, the jquery bundle only results in a blank line in the output.

How can I fix this?

1 Answers1

0

Use BundleTable.EnableOptimizations = true; that will makes bundling and minification regardless of your debug mode.

gunvant.k
  • 1,096
  • 1
  • 10
  • 15
  • Picky question: if this is otherwise decided by debug mode, why does turning off debug mode not help? –  Nov 10 '14 at 19:50
  • Instead of including min.js if you just refer .js version MVC will do minification for you when in release and use regular version in debug mode. you don't explicity needs to refer min.js. and if optimization is enabled it will do minification regardless of your debug mode. – gunvant.k Nov 10 '14 at 20:12