I have downloaded MVC4 and trying to work out how the bundling feature works in a standard project. It would seem that having the bundle:
<script src="@System.Web.Optimization.BundleTable.Bundles.ResolveBundleUrl("~/Scripts/js")"></script>
Brings back all the jquery.js files but not the knockout.js files in the included scripts. Why is this? And also what is the _references.js file about and why is the knockout.js file commented out?
If you look into your project
Global.asax
file, you should find there something like this:Now the
RegisterTemplateBundles
is registering only a predefined subset of scripts:If you want some additional files you could either change
RegisterTemplateBundles
toEnableDefaultBundles
:Or create your own custom bundle (you can read more about bundling and minification here). You should also know that
EnableDefaultBundles
has some performance impact.The
_references.js
file is used by Visual Studio for JavaScript intellisense. You can learn more from following article: