what is {version} in ScriptBundle("~/scripts/jquery-{version}.js")
Asked Answered
D

3

22

I try to get started with MVC SPA apps, and I noticed in BundleConfig the following:

 ScriptBundle("~/scripts/jquery-{version}.js")

How this works? What is {version} and where it it taken from?

And where can find more information this, how BundleConfig works and how to customize it?

Thanks

Depressor answered 24/4, 2013 at 8:40 Comment(2)
possible duplicate of {version} wildcard in MVC4 BundleLaritalariviere
Better answer here: #12029661Baler
B
15

See the answers to this question.

Also, check out this link. The Bundling and Optimization section discusses the use of the {version} tag.

Broomfield answered 24/4, 2013 at 8:44 Comment(0)
P
4

It allows you to indicate a version number format (semver) that many libraries use. For example, you reference jquery-1.9.1 and then it goes to jquery-1.9.2. Using {version} you don't have to change your code, you just need to re build the bundle.

Psychophysiology answered 24/4, 2013 at 11:53 Comment(0)
C
0

Although the above answers are sufficient enough, just wanted to show the technical detail mentioned in the answer link by Matt:

The -{version} basically maps to a version regex, or to be precise: (\d+(?:.\d+){1,3}).

HTH.

Chimpanzee answered 5/10, 2020 at 21:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.