23

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

2

3 Answers 3

15

See the answers to this question.

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

Sign up to request clarification or add additional context in comments.

Comments

5

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.

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.