Bundling Using XML with the Web Essentials Extension

We saw, with the release of MVC 4, the addition of a bundling and minification framework for the optimisation of web resources. This can be configured using the new API (in code). However, I have now stumbled upon an alternative way of implementing bundling using XML files.

Firstly, you need to install the Web Essentials Visual Studio extension (I would use Nuget for that).
If you want to bundle up some JavaScript files, all you need to do is right-click on the files which are to be added to the new bundle and then click on Create JavaScript bundle file from the context menu:
Your solution will now look something like this:
The cool thing is, if you change any of the source JavaScript files, the files in the bundle are automatically updated.
Nice work Mads!

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>