1

After installing the SignalR NuGet package:

Install-Package Microsoft.AspNet.SignalR -pre 

I get the following files:

jquery.signalR-1.0.0-rc2.js
jquery.signalR-1.0.0-rc2.min.js

I register the bundle:

bundles.Add(new ScriptBundle("~/bundles/jquery.signalR").Include(
            "~/Scripts/jquery.signalR-{version}.js"));

In my view I call:

@Scripts.Render("~/bundles/jquery.signalR")

It all works during development, but once I enable:

BundleTable.EnableOptimizations = true;

The bundle fails to render the script.

I've also tried:

bundles.Add(new ScriptBundle("~/bundles/jquery.signalR").Include(
            "~/Scripts/jquery.signalR-{version}-rc2.js"))

which is a bit useless, since the whole point of using {version} is to be ready for future releases, and the next release is getting rid of the "-rc2" bit.

How can I effectively use wild card matching to my advantage to match the script:

jquery.signalR-1.0.0-rc2.js

in development, and

jquery.signalR-1.0.0-rc2.min.js

in production, while at the same time being prepared for a future update of SignalR?

Carlos Nuñez
  • 470
  • 1
  • 3
  • 12

1 Answers1

3

The {version} moniker in bundling does not work for pre-release scripts. To work with pre-release scripts you can use the following registration

bundles.Add(new ScriptBundle("~/bundles/jquery.signalR").Include(
        "~/Scripts/jquery.signalR*"));
Matthew Abbott
  • 60,571
  • 9
  • 104
  • 129
pranav rastogi
  • 4,124
  • 23
  • 23
  • Thank you. This great info. Where in the documentation could I find more detailed explanation? I was going by this article. http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification Is there a more detailed explanation of what patterns and wildcards I can use inside ScriptBundle.Include? – Carlos Nuñez Feb 04 '13 at 20:38