Ideas Into Software

Musings on writing code

All posts tagged modules

TypeScript Conditional Imports And Reference Elision

ES6 modules specification explicitly states import/export statements may only be used at the top level of files. Static imports like this bring about a number of benefits such as first-class support for circular dependencies between modules and (potential) support for macros but it also means you cannot conditionally import modules. Which can be a fairly big issue if you're