Closed
Description
The --import
compiler option can be specified multiple times on the command line, or would be a string array in tsconfig.json. Its argument is a module name which would be imported at the top of every external module in the project.
For example, the following command line:
tsc app.ts --import module
Would be the equivalent of:
// app.ts
import "module";
The named module will be resolved in the same way the above import declaration's module would be resolved, so the module name must either be declared as an ambient external module or resolve to a valid path relative to each external module in the list of sources, unless that would mean importing itself.
This is to support loading an external library of TypeScript helper functions as well as various polyfill and shim libraries.