Created
October 2, 2012 10:37
-
-
Save mitsuhiko/3818101 to your computer and use it in GitHub Desktop.
This file contains 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
mitsuhiko at nausicaa in /tmp/testing | |
$ cat foo.ts | |
export function getRandomNumber() { | |
return 42; | |
} | |
mitsuhiko at nausicaa in /tmp/testing | |
$ cat test.ts | |
import foo = module('./foo'); | |
export function doSomething() { | |
return foo.getRandomNumber() * 2; | |
}; | |
mitsuhiko at nausicaa in /tmp/testing | |
$ tsc --module amd *.ts | |
mitsuhiko at nausicaa in /tmp/testing | |
$ cat foo.js | |
define(["require", "exports"], function(require, exports) { | |
function getRandomNumber() { | |
return 42; | |
} | |
exports.getRandomNumber = getRandomNumber; | |
}) | |
mitsuhiko at nausicaa in /tmp/testing | |
$ cat test.js | |
define(["require", "exports", './foo'], function(require, exports, __foo__) { | |
var foo = __foo__; | |
function doSomething() { | |
return foo.getRandomNumber() * 2; | |
} | |
exports.doSomething = doSomething; | |
; ; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment