Building Single Page Application – Bundle Orderer

27 בדצמבר 2013

In my previous post I discussed a way to arrange scripts in a single page application. Short story: each application layer is associated with exactly one bundle. Assuming a vertical dependency between layers, we can just include the bundles in the right order and any time we add a new file to a layer that file is automatically added in the right position with respect to other files in other layers. For example, below is a common bundle configuration in my single page applications bundles.Add(new ScriptBundle("~/bundles/lib")     .IncludeDirectory("~/Scripts/Lib", "*.js", true)); bundles.Add(new ScriptBundle("~/bundles/server")     .IncludeDirectory("~/Scripts/Server", "*.js", true)); bundles.Add(new ScriptBundle("~/bundles/bl")     .IncludeDirectory("~/Scripts/BL", "*.js", true)); bundles.Add(new ScriptBundle("~/bundles/views")     .IncludeDirectory("~/Scripts/Views", "*.js", true)); bundles.Add(new ScriptBundle("~/bundles/app")     .IncludeDirectory("~/Scripts/App", "*.js", true)); Please note that each bundle is configured to include a specific directory. This means that when you add a...