Concatenate AMD and System modules with —outFile

Specifying —outFile in conjunction with —module amd or —module system will concatenate all modules in the compilation into a single output file containing multiple module closures.

A module name will be computed for each module based on its relative location to rootDir.

Example
  1. // file src/a.ts
  2. import * as B from "./lib/b";
  3. export function createA() {
  4. return B.createB();
  5. }
  1. // file src/lib/b.ts
  2. export function createB() {
  3. return { };
  4. }

Results in:

  1. define("lib/b", ["require", "exports"], function (require, exports) {
  2. "use strict";
  3. function createB() {
  4. return {};
  5. }
  6. exports.createB = createB;
  7. });
  8. define("a", ["require", "exports", "lib/b"], function (require, exports, B) {
  9. "use strict";
  10. function createA() {
  11. return B.createB();
  12. }
  13. exports.createA = createA;
  14. });