Saturday, April 25, 2015

Bundling

Bundling is all about compressing several JavaScript or stylesheets files without any formatting (also referred as minified) into a single file for saving bandwidth and number of requests to load a page.

bundles.Add(New ScriptBundle("~/bundles/jqueryBundle").Include(
            "~/Resources/Core/Javascripts/jquery-1.7.1.min.js",
            "~/Resources/Core/Javascripts/jquery-ui-1.8.16.min.js",
            "~/Resources/Core/Javascripts/jquery.validate.min.js"))

and can be rendered

@Scripts.Render("~/bundles/jquerybundle");

For stylesheets StyleBundle and @Styles.Render() need to be used.

Technorati Tags:

No comments:

Post a Comment