I'm upgrading an ASP.NET MVC5 project to MVC Core 2.1, using Bundling and Minify (https://learn.microsoft.com/en-us/aspnet/core/client-side/bundling-and-minification). Is there an equivalent to the {version}
file matching pattern from MVC5 in Core 2.1?
For example, using this simplified example bundle:
Bundling, in MVC 5 (works, it loads the jQuery file without specifying the version number):
// bundleconfig.cs
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/scripts/jquery-{version}.js"));
Translated into Core 2.1 (does not find the file):
// bundlingconfig.json
[
{
"outputFileName": "wwwroot/bundles/jquery.min.js",
"inputFiles": [
"wwwroot/scripts/jquery-{version}.js"
],
]
However, if I explicitly set the version number of the file in Core 2.1, like wwwroot/scripts/jquery-2.1.3.js
it will find the file.
There's no support for this in ASP.NET Core. Client-side libraries are handled in a more modern approach, where they are treated more like packages, pulled down via bower, libman, or npm, and updated in place, such that your files don't have version numbers in the first place.