I really like JavascriptMVC's "include" function, which can be used in two modes. In development mode it works much like "require" and loads an external script. But there's also a production mode where all "includes" are processed ahead of time and used to compile the whole application into a single file.
Obviously you need to restrict the use somewhat for this to work (no conditional includes, for example).
http://github.com/jquery/jquery/tree/omgrequire/src/
And here's a direct link to the function itself:
http://github.com/jquery/jquery/blob/998cb005fc378188b3bae31...