Q:

ReqireJS separate application in different 'silos'

I am authoring a "single-page app". I put single-page in quotes because I will be making a round-trip page reload for each use-case listed below:

Before user authentication
After user authentication
Only for administrators

I want to reduce the amount of bytes needed to startup the application, and also hide logic/code for users which do not have authorization to use it. This is why I'm thinking I want to separate the application into three different bulks according to these use-cases.
I also want to make a general bulk of third-party vendor libraries/frameworks also. These will be used across use-cases, and with browser caching enabled, I will save up on even more bytes and load time when user reloads into a new use-case/mode.
I am using AngularJS for application logic and routing, and I want to use RequireJS for dependency injection/mapping. This will also help me define which code files will go into which use-case bulks, as they might re-use application code across different use-cases.
Now, I've read up on my RequireJS but as far as I can see there's no way for me to configure RequireJS to handle three different application flows like this in a DRY manner. 
I can have one 'main.js' per use-case which all bootstrap angular using the same path and shim configuration, but that would not be DRY.
example:
require.config({
    baseUrl: 'js/app',
    paths: {
        // Setting up paths to required libraries
        'jquery':           '../vendor/jquery/jquery',
        'angular':          '../vendor/angular/angular',
        'ngRoute':          '../vendor/angular-route/angular-route',
        'ngSanitize':       '../vendor/angular-sanitize/angular-sanitize',
        'ngCookies':        '../vendor/angular-cookies/angular-cookies',
        'ngResource':       '../vendor/angular-resource/angular-resource'
    },
    shim: {
        'angular':          {exports: 'angular'},
        'ngRoute':          {deps: ['angular']},
        'ngSanitize':       {deps: ['angular']},
        'ngCookies':        {deps: ['angular']},
        'ngResource':       {deps: ['angular']}
    }
});
require(['beforeLoginApp', 'jquery'], function (app, $) {

    // Since the HTML tag is hidden amongst a lot of
    // browser version checks, we set the main app controller
    // here.
    var $html = $('html');
    $html.attr('ng-controller', 'AppController');

    // Startup the Angular framework with our application
    angular.bootstrap(document, [app.name]);

    return true;
});

This file must then be copied for all use-cases, and switching between requiring 'beforeLoginApp', 'afterLoginApp' and 'adminApp'. And I would not be able to separate vendor libs from application code, preventing browsers from caching vendor libs between the three different page loads.
There must be a better way...

A:

It is possible to call require.config multiple times so you could have a configuration common to all cases and configurations that set up only what a specific case needs.
The multipage example gives one possible organization which could be adapted to this task. For instance, js/page1.js could be:
// Loads the common config.
require(['./common'], function (common) {
    require.config({
        // Additional config specific to page 1.
    });
    require(['app/main1']);
});

This provides some support to avoid repetition.

