bebraw
12/13/2010 - 4:49 PM

file_structure.txt

define([
        .. // some misc. imports
        // plugins
        './plugin1', './plugin2' // these have to be stated explicitly :(
    ], function(... // some misc. imports
        // plugins
        plugin1, plugin2 // optional (attributes works too)
        ) {
        // do something with the loaded modules now (each module returns Object with various handy methods ie.)

        // ouch! I have to use "arguments" to access my plugins. not so pretty
        // alternatively I could refer directly to "plugin1" and "plugin2" (even uglier)
        ...
});
define({
    initialize: function() {...} // this will be called at plugins.js
});
/plugins/plugins.js
/plugins/plugin1.js
/plugins/plugin2.js