title: RequireJS: How to define modules that contain a single "class"?
body: <p>I have a number of JavaScript "classes" each implemented in its own JavaScript file. For development those files are loaded individually, and for production they are concatenated, but in both cases I have to manually define a loading order, making sure that B comes after A if B uses A. I am planning to use <a href="http://requirejs.org/" rel="noreferrer">RequireJS</a> as an implementation of <a href="http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition" rel="noreferrer">CommonJS Modules/AsynchronousDefinition</a> to solve this problem for me automatically.</p>
  
  <p>Is there a better way to do this than to define modules that each export one class? If not, how to you name what the module exports? A module "employee" exporting a class "Employee", as in the example below, doesn't feel <a href="http://en.wikipedia.org/wiki/DRY" rel="noreferrer">DRY</a> enough to me.</p>
  
  <pre><code>define("employee", ["exports"], function(exports) {
      exports.Employee = function(first, last) {
          this.first = first;
          this.last = last;
      };
  });
  
  define("main", ["employee"], function (employee) {
      var john = new employee.Employee("John", "Smith");
  });
  </code></pre>