What is the TypeScript way of loading modules dynamically (path to the module is known at runtime)? I tried this one:
var x = "someplace"
import a = module(x)
But it seems that TypeScript compiler would like to see path as a string in import/module at compile time:
$ tsc test.ts
/tmp/test.ts(2,19): error TS1003: Identifier expected.
/tmp/test.ts(2,20): error TS1005: ';' expected.
I know I can for example directly use RequireJS (if I use amd module format), but that doesn't feel right to me - it's solution for one particular library.
const a = require('x')
? – Meridethmeridian