fix(ivy): use ReflectionHost
in AbsoluteModuleStrategy
(#30200)
The AbsoluteModuleStrategy in ngtsc assumed that the source code is formatted as TypeScript with regards to module exports. In ngcc this is not always the case, so this commit changes `AbsoluteModuleStrategy` so that it relies upon a `ReflectionHost` to compute the exports of a module. PR Close #30200
This commit is contained in:

committed by
Jason Aden

parent
02523debe5
commit
76391f8999
@ -438,7 +438,8 @@ export class NgtscProgram implements api.Program {
|
||||
// First, try to use local identifiers if available.
|
||||
new LocalIdentifierStrategy(),
|
||||
// Next, attempt to use an absolute import.
|
||||
new AbsoluteModuleStrategy(this.tsProgram, checker, this.options, this.host),
|
||||
new AbsoluteModuleStrategy(
|
||||
this.tsProgram, checker, this.options, this.host, this.reflector),
|
||||
// Finally, check if the reference is being written into a file within the project's logical
|
||||
// file system, and use a relative import if so. If this fails, ReferenceEmitter will throw
|
||||
// an error.
|
||||
|
Reference in New Issue
Block a user