Exercise 4: Bundling and Minification
Bundling and minification in ASP.NET 4.5 is performed at runtime, so that the process can identify the user agent (for example IE, Mozilla, etc.), and thus, improve the compression by targeting the user browser (for instance, removing stuff that is Mozilla specific when the request comes from IE).
In this exercise, you will learn how to enable and use the different types of bundling and minification in ASP.NET 4.5.
Task 1 – Installing the Bundling and Minification Package from NuGet
Task 2 – Default Bundles
The simplest way to use bundling and minification is to enable the default bundles. This method uses conventions to let you reference the bundled and minified version for the JS and CSS files in a folder.
In this task, you will learn how to enable and reference the bundled and minified JS and CSS files and view the resulting output.
Task 3 – Static Bundles
The static bundle approach allows you to customize the set of files to bundle, the reference and the minification method that will be used.
In this task, you will configure a static bundle to define a specific set of files to bundle and minify.
Task 4 – Dynamic Folder Bundles