perf(compiler-cli): ensure module resolution cache is reused for type-check program (#39693)
perf(compiler-cli): ensure module resolution cache is reused for type-check program (#39693)

The Angular compiler creates two `ts.Program`s; one for emit and one for
template type-checking. The creation of the type-check program could
benefit from reusing the `ts.ModuleResolutionCache` that was primed
during the creation of the emit program. This requires that the compiler
host implements `resolveModuleNames`, as otherwise TypeScript will setup
a `ts.ModuleResolutionHost` of its own for both programs.

This commit ensures that `resolveModuleNames` is always implemented,
even if the originally provided compiler host does not. This is
beneficial for the `ngc` binary.

PR Close #39693

angular-indonesia/angular,angular-indonesia/angular,ocombe/angular,brandonroberts/angular,manekinekko/angular,JiaLiPassion/angular,manekinekko/angular,gnomeontherun/angular,brandonroberts/angular,shairez/angular,mgechev/angular,manekinekko/angular,mgechev/angular,angular/angular,shairez/angular,gkalpak/angular,mgechev/angular,angular/angular,ocombe/angular,gkalpak/angular,brandonroberts/angular,gnomeontherun/angular,mgechev/angular,manekinekko/angular,shairez/angular,gnomeontherun/angular,brandonroberts/angular,gnomeontherun/angular,JiaLiPassion/angular,angular/angular,ocombe/angular,brandonroberts/angular,brandonroberts/angular,gkalpak/angular,gkalpak/angular,mgechev/angular,shairez/angular,ocombe/angular,angular/angular,manekinekko/angular,JiaLiPassion/angular,angular-indonesia/angular,angular-indonesia/angular,ocombe/angular,shairez/angular,manekinekko/angular,ocombe/angular,JiaLiPassion/angular