perf(bazel): use allowedInputs to avoid fs.stat (#46069)
perf(bazel): use allowedInputs to avoid fs.stat (#46069)

Call tsc_wrapped's fileExists function instead of TypeScript's.

tsc_wrapped (used internally by ngc-wrapped) has an optimization under
bazel to avoid file system calls where possible. It takes advantage
bazelOpts.allowedInputs, which contains a list of all files available
for compilation.

File system calls can be quite slow depending on the file system. In
google3 I saw a 38 seconds compilation, which spent 6 seconds just doing
fs.stat calls during module resolution. Those fs.stat calls are entirely
gone after with this change.

PR Close #46069

gnomeontherun/angular,angular/angular,gkalpak/angular,gnomeontherun/angular,JiaLiPassion/angular,JiaLiPassion/angular,JiaLiPassion/angular,angular-indonesia/angular,angular-indonesia/angular,JiaLiPassion/angular,gkalpak/angular,angular-indonesia/angular,gkalpak/angular,angular/angular,angular/angular,angular-indonesia/angular,gnomeontherun/angular,angular/angular,gnomeontherun/angular,gkalpak/angular