There are many ways to solve an issue. Some work better than others though their pureness may be questionable. Getting many JS scripts and modules loaded is one such puzzle. I’m not a huge fan of require.js for a number of reasons that are already clearly, and eloquently, expressed by others. It is great at what it does, just not what I really want to use.What I do like is using a tool such as YUI compressor to facilitate delivering robust production code.
The following code is something I found on http://www.laurencegellert.com/ which I have since extended and included into my own projects.
# This script generates the following:
# temp.js is the uncompressed file with everything combined
java -jar yuicompressor-2.4.7.jar --type js -o ./app/js/temp.js --charset utf-8 ./app/js/combined.min.js
echo "Cleaning up temporary files."
And yes, I do work on OSX as well as Win8.