1

As per MS bundling dev the {version} wildcard is a regex for (\d+(?:.\d+){1,3}). This differentiates between:

jquery-1.8.2.js
jquery-ui-1.9.0.js

But because of non-numeric numbering (#.#.#pre) it chokes on:

html5shiv-3.6.2pre.min.js
html5shiv-printshiv-3.6.2pre.min.js

So I'm doing this: html5shiv-3* and html5shiv-printshiv-*. But of course this means I must update the bundles when the scripts change.

I just took html5shiv as a simple example. This problem is widespread as inclusion of "pre", "beta", "-a", "-alpha", etc., is common. The solution is to rename the files manually, but then it's not automated via nuget.

Am I doing something wrong?

Community
  • 1
  • 1
Bobby B
  • 2,287
  • 2
  • 24
  • 47

2 Answers2

1

It sounds like the {version} regex should match semantic versions to account for the -pre/alpha1 suffixes. I'll add this to our backlog.

Hao Kung
  • 28,040
  • 6
  • 84
  • 93
  • That would help a great deal, and make automatic usage of tons of nuget packages possible. Not sure how to account for all the different patterns out there though. Maybe to look for the trailing "." or ".min" or ".css" or ".min.css" or something like that. – Bobby B Oct 16 '12 at 21:46
0

I don't understand your problem.

If you use the syntax {version} you can still use suffixes such as -pre or -min

an example would be

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

It doesn't have to include the -min in the version variable.

Dave Hogan
  • 3,201
  • 6
  • 29
  • 54
  • I think the "pre" is part of the version number? The next version might have it, might not. Think of "1.2.3beta", the next version might not have the "beta". So if you put it into the declaration, you'd have to edit it every time. – Bobby B Oct 13 '12 at 09:42
  • Also, I didn't know suffixes were allowed! Is there a list of official allowed suffix/prefix/wildcards anywhere? I haven't seen comprehensive docs on this yet. – Bobby B Oct 13 '12 at 09:43