I don’t know if RequireJS has controllable order of execution for async loaded scripts… however, I can tell you how I did it with LABjs:
“self.config.jqwidgets” contains the names of the modules which need to be loaded, as an array in proper order
“LABjs” is the loader instance
LABjs.setGlobalDefaults({ AlwaysPreserveOrder: true});LABjs.queueScript("/jqwidgets/jqxcore.js");for(c = 0; c< self.config.jqwidgets.length; c++) LABjs.queueScript("/jqwidgets/jqx"+self.config.jqwidgets[c]+".js");LABjs.queueWait(function() { // ... do widgets initialization here});LABjs.runQueue();
Hope this helps and you find a similar solution for RequireJS !