0

By default there are these code lines in the asp.net mvc solution

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

So if I have these files

jquery.validate.js
jquery.validate.min.js
jquery.validate.unobtrusive.js
jquery.validate.unobtrusive.min.js
jquery.validate-vsdoc.js
jquery-1.10.2.js
jquery-1.10.2.intellisense.js
jquery-1.10.2.min.js
jquery-1.10.2.min.map

which of them will be included in the rendered page? And what do these symbols {version}, * mean? I understand {version} is replaced by the number 1.10.2, but what rule is used with * ?

Wachburn
  • 2,842
  • 5
  • 36
  • 59

1 Answers1

0

First bundle will render:

<script src="/Scripts/jquery-1.10.2.js"></script>

and jquery.validate bundle will render:

 <script src="/Scripts/jquery.validate.js"></script>
 <script src="/Scripts/jquery.validate.unobtrusive.js"></script>

as you can see * means that will be included all files.

@update

Above is in debug mode in release min files will be included like here:

<script src="/Scripts/jquery.validate.min.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.min.js"></script>

vsdoc file is intellisense for visual studio. So there is no point in including this file in webpage

szpic
  • 4,346
  • 15
  • 54
  • 85
  • why is .min ignored? it considered in the c# code? And what about jquery.validate-vsdoc.js ? – Wachburn Feb 13 '14 at 09:40
  • yes, I know there is no point in including this file, but HOW MVC KNOW that there is no point in including this file? beacause if I create jquery.validate-TEMP.js it will include in the page – Wachburn Feb 13 '14 at 09:55
  • It's not explained in details. On the asp.net site you can only find info that compiler ignore -vsdoc.js file/intellisense file in redenring. [Click](http://www.asp.net/mvc/tutorials/mvc-4/bundling-and-minification) Ofc you can create your own filtering mechanism and ignore temp ;) – szpic Feb 13 '14 at 10:10