title: Bundling in asp.net
body: <p>I'm using bundling in an ASP.net MVC application. I want to build my bundles in a hierarchical fashion.</p>
  
  <p>For instance, these are the scripts I want on all my webpages:</p>
  
  <pre><code> bundles.Add(new ScriptBundle("~/bundles/bootstrap-js").Include(
                                           "~/Scripts/bootstrap.js",
                                           "~/Scripts/respond.js",
                                           "~/Scripts/bootstrap-datetimepicker.min.js",
                                           "~/Scripts/jquery.smartmenus.js",
                                           "~/Scripts/jquery.smartmenus.bootstrap.js"
                                           ));
  </code></pre>
  
  <p>Next I want to have for example knockout on only some pages: </p>
  
  <pre><code>bundles.Add(new ScriptBundle("~/bundles/knockout-js").Include(
                                  "~/Scripts/knockout/knockout-3.4.0.js",
                                  "~/Scripts/knockout/knockout-kendo.js",
                                  "~/Scripts/knockout/knockout.mapping-latest.js",
                                  "~/Scripts/knockout/knockout.validation.js",
                                  "~/Scripts/knockout/knockout.validation.de-DE.js",
                                  "~/Scripts/knockout/knockout.validation.fr-BE.js",
                                  "~/Scripts/knockout/knockout.validation.nl-BE.js",
                                  "~/Scripts/knockout/Knockout.bindinghandlers.js",
                                  "~/Scripts/knockout/knockout.validation.mvc.js"));
  </code></pre>
  
  <p>And finally, I want every page to have it's own custom script.</p>
  
  <pre><code>bundles.Add(new ScriptBundle("~/bundles/scriptName-js").Include(
                                  "~/Views/Cards/scriptName.js"));
  </code></pre>
  
  <p>Is there a way so I only have to include one @scripts.render statement by combining all previous bundles in to one bundle?</p>
  
  <pre><code> @Scripts.Render("~/bundles/mypage-js")
  </code></pre>
  
  <p>I tried this but it didn't work: </p>
  
  <pre><code> bundles.Add(new ScriptBundle("~/bundles/mypage-js").Include("~/bundles/scrip‌​tName-js","~/bundles‌​/knockout-js","~/bun‌​dles/bootstrap-js"))‌​; 
  </code></pre>