Skip to content

Instantly share code, notes, and snippets.

@mitsuhiko
Created October 2, 2012 10:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitsuhiko/3818101 to your computer and use it in GitHub Desktop.
Save mitsuhiko/3818101 to your computer and use it in GitHub Desktop.
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