title: How can I make code generated by TypeScript using AMD modules, actually execute?
body: <p>I just started using TypeScript and I made 2 files, lib.ts and main.ts, and picked AMD modules during compilation. The compiler generates one file with definitions but it doesn't actually call any function to execute. The contents of the main.ts file are just wrapped inside a module.
  Here are the files:</p>
  
  <p>lib.ts</p>
  
  <pre><code>export namespace Library {
      export class Write {
          constructor() {
              console.log("hello world");
          }
      }
  }
  </code></pre>
  
  <p>main.ts</p>
  
  <pre><code>import {Library} from "./lib";
  new Library.Write();
  </code></pre>
  
  <p>The compiler command:</p>
  
  <pre><code>tsc main.ts --outFile out.js --module amd
  </code></pre>
  
  <p>out.js</p>
  
  <pre><code>define("lib", ["require", "exports"], function (require, exports) {
      "use strict";
      var Library;
      (function (Library) {
          var Write = (function () {
              function Write() {
                  console.log("hello world");
              }
              return Write;
          }());
          Library.Write = Write;
      })(Library = exports.Library || (exports.Library = {}));
  });
  define("main", ["require", "exports", "lib"], function (require, exports, lib_1) {
      "use strict";
      new lib_1.Library.Write();
  });
  </code></pre>
  
  <p>How can I get the compiler to actually generate code that executes? The documentation does not help.</p>