RequireJS - Managing Modules in the Center

Maybe I missed this in the documentation somewhere, but here. I have a main controller that deals with module management. So far I have about 20 modules, and I would like to be able to easily configure them to boot the kernel. This means that I have a large array or many calls. Is it an acceptable / good practice to create a list of modules in a literal object, and then the module loads its dependencies from this? Here is an example of what I mean:

config.js

modules = [
    'moduleA',
    'moduleB',
    'moduleC'
];

core.js

define(
    ['config'],
    function(config) {
        // Somewhere in here I parse the list and require() each one ?   
        return {
            startAll : function() {
                console.log('starting all modules.');

                // Then call a method common to all 'modules' in the list above.
            }
        }
    };
  }
);

I'm not sure if this is such a good idea as I am new to RequireJS, but I like the idea of ​​setting up which modules load from one place. In my case, modulo, I mean the user interface widgets that I wrote more specifically.

+5
1

, "package". . , , :

widgets.js:

define(['./widgets/button', ...], function(button) {
    return {
        button: button, // expose the widgets here
        ...
    }
});

. , , .

. . , .

RequireJS, . , . , , ...

+3