There\'s a feature in TypeScript which I like so much and that\'s external modules using RequireJs and that the fact that the compiler won\'t include imported modules unless
There is a simply fiddle you can do to get the compiler to include both:
import A = require('./A');
import B = require('./B');
var a = new A();
var b = B;
The variable b
becomes noise in your program, so I wouldn't use this technique too much, but if the B
module is doing polyfills or something like that which means you'll never want to directly instantiate it, this gets it loaded for you.
Another way to do it:
/// <amd-dependency path="./B" />
import A = require('./A');
No need to create fictitious code