AMD Module names

By default AMD modules are generated anonymous. This can lead to problems when other tools are used to process the resulting modules like a bundler (e.g. r.js).

The new amd-module name tag allows passing an optional module name to the compiler:

  1. //// [amdModule.ts]
  2. ///<amd-module name='NamedModule'/>
  3. export class C {
  4. }

Will result in assigning the name NamedModule to the module as part of calling the AMD define:

  1. //// [amdModule.js]
  2. define("NamedModule", ["require", "exports"], function (require, exports) {
  3. var C = (function () {
  4. function C() {
  5. }
  6. return C;
  7. })();
  8. exports.C = C;
  9. });