There are a couple of things that bug me about RequireJS's data-main method of single-script loading:
<script src="js/requirejs/require.js" data-main="app/main.js"></script>
- the built file (bundle) must be named "require.js". WAT.
- it just seems backwards.
data-main
does not follow w3c recommendations since it's not name-spaced.
Here are two examples of what came to mind when I spent a few minutes thinking about alternatives. The first one is an example of a double-script bootstrap. This is a great alternative if loading curl.js from a CDN since the scripts will load in parallel.
The second example uses a single script element. This is a great alternative if you decide to bundle curl.js into run.js. The problem is that there's a lot of boilerplate in run.js. However, the example run.js compresses down to 500 bytes (333 gzipped). Not too bad?
Heh, I almost called it "loadCurlThenRun". shoulda known :)