0
votes

I have the following code in my Application_Start():

    protected void Application_Start() {

        AreaRegistration.RegisterAllAreas();
        WebApiConfig.Register(GlobalConfiguration.Configuration);
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        RoleConfig.CreateRoles();
        BundleConfig.RegisterBundles(BundleTable.Bundles);

and:

namespace WebUx {
    public class BundleConfig {
        // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725
        public static void RegisterBundles(BundleCollection bundles) {

            bundles.Add(new ScriptBundle("~/bundles/admin").Include(
                        "~/Scripts/admin/adminControl.js",
                        "~/Scripts/admin/adminModalOpen.js",
                        "~/Scripts/admin/adminModalOpen.js",
                        "~/Scripts/admin/getExamOptions.js",
                        "~/Scripts/admin/getParams.js",

When I use the debug to break on the first line of Application_Start and then check BundleTable.Bundles I see there are already entries in the BundleCollection.

These entries are not my entries and they appear to be nothing to do with the files in my application. Rather they appear to be the defaults. For example my application has just one jQuery file whereas the BundleCollection has seven jQuery related js files.

Does anyone know how/why these files are in the BundleCollection and how they are set up?

For example: How and why do I find bundles called moo, dojo, prototype, ext etc. These are not bundles I created so where do they all come from. I am totally confused here. Can't find anything that would cause these bundles to be created.

1

1 Answers

2
votes

I think you might be looking at some of the default ordering conventions, as opposed to the actual included files in the bundle. My hunch is you are looking at the FileSetOrderList, that basically does some order promoting for several well known js frameworks that typically need to be first (i.e. jquery).

You can get rid of all of the default conventions by calling ResetAll() on your bundle collection. But in general they are only there to help with implicit ordering if you were to include *.js.