From c64a5f9d1b2e1a3e8f41269cd042e72fc59ccd3c Mon Sep 17 00:00:00 2001 From: Halil ibrahim Kalkan Date: Thu, 14 Jun 2018 01:58:57 +0300 Subject: [PATCH] Added best practice section to bundles. --- docs/AspNetCore/Bundling-Minification.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/AspNetCore/Bundling-Minification.md b/docs/AspNetCore/Bundling-Minification.md index 414af4d762..5a3114731a 100644 --- a/docs/AspNetCore/Bundling-Minification.md +++ b/docs/AspNetCore/Bundling-Minification.md @@ -243,10 +243,21 @@ namespace MyCompany.MyProject } ```` -#### Themes +### Themes Themes uses the standard package contributors to add library resources to page layouts. Themes may also define some standard/global bundles, so any module can contribute to those standard/global bundles. See the [theming documentation](Theming.md) for more. +### Best Practices & Suggestions + +It's suggested to define multiple bundles for an application, each one is used for different purposes. + +* **Global bundle**: Global style/script bundles are included to every page in the application. Themes already defines global style & script bundles. Your module can contribute to them. +* **Layout bundles**: This is a specific bundle to an individual layout. Only contains resources shared among all the pages use the layout. +* **Module bundles**: For shared resources among an individual module pages. +* **Page bundles**: Specific bundles created for each page. Use the bundling tag helpers to create the bundle. + +Establish a balance between performance, network bandwidth usage and managing too many bundles. + ### See Also * [Client Side Package Management](Client-Side-Package-Management.md)