FileToModuleHost aliasing supports compilation within environments that have two properties: 1. A `FileToModuleHost` exists which defines canonical module names for any given TS file. 2. Dependency restrictions exist which prevent the import of arbitrary files even if such files are within the .d.ts transitive closure of a compilation ("strictdeps"). In such an environment, generated imports can only go through import paths which are already present in the user program. The aliasing system supports the generation and consumption of such imports at runtime. `FileToModuleHost` aliasing does not emit re-exports in .d.ts files. This means that it's safe to rely on alias re-exports in generated .js code (they are guaranteed to exist at runtime) but not in template type-checking code (since TS will not be able to follow such imports). Therefore, non-aliased imports should be used in template type-checking code. This commit adds a `NoAliasing` flag to `ImportFlags` and sets it when generating imports in template type-checking code. The testing environment is also patched to support resolution of FileToModuleHost canonical paths within the template type-checking program, enabling testing of this change. PR Close #34649
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT