Created
January 21, 2014 22:55
-
-
Save aindlq/8550165 to your computer and use it in GitHub Desktop.
Typescript amd module compilation. tsc v. 0.9.5.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="a.ts" /> | |
/// <reference path="b.ts" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="_all.ts" /> | |
module A { | |
export function fA() { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="_all.ts" /> | |
module A { | |
export function fB() { | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="_all.ts" /> | |
export module C { | |
function run() { | |
A.fA(); | |
A.fB(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tsc c.ts --out out.js -m amd -d | |
output: actually two files out.js an c.js. | |
out.js: | |
/// <reference path="_all.ts" /> | |
var A; | |
(function (A) { | |
function fA() { | |
} | |
A.fA = fA; | |
})(A || (A = {})); | |
/// <reference path="_all.ts" /> | |
var A; | |
(function (A) { | |
function fB() { | |
} | |
A.fB = fB; | |
})(A || (A = {})); | |
c.js: | |
/// <reference path="_all.ts" /> | |
define(["require", "exports"], function(require, exports) { | |
(function (C) { | |
function run() { | |
A.fA(); | |
A.fB(); | |
} | |
})(exports.C || (exports.C = {})); | |
var C = exports.C; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment