Minification and bundling in MVC 4

Ashif Avatar

In MVC 4.0 or 4.5 , new feature came from microsoft  is Bundling and minification.

A)Bundling : Previously Files like multiple css and javascript , which were in queue for selecting single file, but in mvc 4 , multiple js or css files can be treat as single file request to browser ,

publicstaticvoidRegisterBundles(BundleCollection bundles){
    bundles.Add(newScriptBundle("~/bundles/jquery").Include("~/Scripts/jquery-{version}.js"));// Code removed for clarity.BundleTable.EnableOptimizations=true;}

For page faster performing and loading it is very useful using the * caharcter multile files in a folder can be added .

B)Minification: Minification is an example of jquery min verion, but using any javascript file can be minified


Leave a Reply

Your email address will not be published. Required fields are marked *