Search code examples
asp.netasp.net-mvcasp.net-mvc-4asp.net-optimizationbundling-and-minification

MVC4 bundle {version} wildcard chokes on non-numeric versioning


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?


Solution

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