title: Use require.js to load named TypeScript modules
body: <p><strong>Brief problem description:</strong> I'd like to use TypeScript to generate AMD-style <em>named</em> modules, which I then want to load from a bundled and minified file using requires.js.</p>
  
  <p><strong>Questions:</strong></p>
  
  <ul>
  <li>Is that possible?</li>
  <li>Or do you suggest another approach?</li>
  </ul>
  
  <p>I want to combine the benefits of having all scripts bundled and minified (so that no additional HTTP requests are necessary) with loading named AMD modules which are generated by TypeScript.</p>
  
  <hr>
  
  <p><strong>Update:</strong> I was thinking along the lines of the following JavaScript solution:</p>
  
  <pre><code>define("greeter", ["require", "exports", "jquery"], function(require, exports, $) {
      function greet() {
          alert("Hello World!");
      }
  
      exports.greet = greet;
  });
  </code></pre>
  
  <p>Then I could bundle and minify the generated JavaScript modules into a file that could easily be cached by browsers. Also, require.js wouldn't have to go out there and grab the modules via several GET requests — they're already defined. Plus, I'd have all the advantages of using TypeScript to generate those modules.</p>