Skip to content

Instantly share code, notes, and snippets.

@aindlq
Created January 21, 2014 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aindlq/8550165 to your computer and use it in GitHub Desktop.
Save aindlq/8550165 to your computer and use it in GitHub Desktop.
Typescript amd module compilation. tsc v. 0.9.5.0
/// <reference path="a.ts" />
/// <reference path="b.ts" />
/// <reference path="_all.ts" />
module A {
export function fA() {
}
}
/// <reference path="_all.ts" />
module A {
export function fB() {
}
}
/// <reference path="_all.ts" />
export module C {
function run() {
A.fA();
A.fB();
}
}
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