@import "one.js" // loaded in parallel to the other two
@import "two.js" // loaded in parallel to the other two
code code code // this is run only after one.js and two.js (but not three.js) have been loaded and run
@import "three.js" // loaded in parallel to the other twoBasically the only way to get this asynchronously loading / synchronously executing behavior is to statically analyze your "root" module for dependencies and load them (and their dependencies, etc). Once they're all loaded you can begin execution and synchronously execute every module as they're imported.
FYI CommonJS (not AMD) loaders for the browser do the same thing to avoid synchronous XHRs that will cause the UI to hang.
Then when you want to move from development to production it concatenates and minifies all the files for improved network performance.
I'm serving a substantial Amber app this way and it works great. I'm taking it a step further by writing most of my code in Coffeescript, and I keep all my Handlebars templates in separate files as well. Sprockets just magically combines it all.