I’m using the new Bundling feature in ASP.NET MVC4. Currently I have the following bundles configured:
- ~/js/jquery
- ~/js/forms
- ˜/js/bootstrap
Depending on the view I’m serving I usually call a combination of these three (e.g. the home page on needs the jquery bundle, while the contact page needs jquery + bootstrap, while forms need all three).
My question would be: is there a way to call the three bundles to be rendered as one file from the view? I don’t want to make bundles for every possible combination:
- ˜/js/formsAndBootstrap
- ˜/js/formsAndJQueryAndBootstrap
- And so on…
It appears you have to define a bundle. It can’t be done “on-the-fly” from the view.