I currently have an internal module defined in foo.ts (edit: that can't be modified)
module Foo {
export function foo(){
console.log('foo');
}
}
that I want to transform in an external module (to use in Node). So I created a bar.ts where I reference foo.ts and then I try to export it.
/// <reference path='foo.ts' />
export = Foo;
When I compile it using tsc -m commonjs --out bundle.js bar.ts I expect it to concatenate the declaration from foo.ts and then the export from bar.ts. However I get foo.ts and bar.ts compiled but separated and then bundle.js only has the same code as foo.js.
var Foo;
(function (Foo) {
function foo() {
console.log('foo');
}
Foo.foo = foo;
})(Foo || (Foo = {}));
Is this even possible to achieve?