Add --import
compiler options to specify module imports that should happen for every module.
#2911
Labels
--import
compiler options to specify module imports that should happen for every module.
#2911
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:
Would be the equivalent of:
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.
The text was updated successfully, but these errors were encountered: