fix(compiler-cli): ngtsc shim files not being generated on case-insensitive platforms (#27466)
Common insensitive platforms are `win32/win64` (see: [here](https://github.com/Microsoft/TypeScript/blob/3e4c5c95abd515eb9713b881d27ab3a93cc00461/src/compiler/sys.ts#L681-L682)) Currently when running `bazel build packages/core --define=compile=aot`, the `compiler-cli` will throw because it cannot find the `index.ngfactory.ts` file in the compiler host. This is because the shim host wrapper is not properly generating the requested `ngfactory` file. This happens because we call `getCanonicalFileName` that returns a path that is different to the actual program filenames that are used to construct a map of generated files. Since the generators always use the paths which are not "canonical" and pases them internally like that, we can just stop manually calling `getCanonicalFileName`. PR Close #27466
This commit is contained in:
committed by
Igor Minar
parent
091a504377
commit
ca1c430f30
@@ -53,10 +53,9 @@ export class GeneratedShimsHostWrapper implements ts.CompilerHost {
|
||||
fileName: string, languageVersion: ts.ScriptTarget,
|
||||
onError?: ((message: string) => void)|undefined,
|
||||
shouldCreateNewSourceFile?: boolean|undefined): ts.SourceFile|undefined {
|
||||
const canonical = this.getCanonicalFileName(fileName);
|
||||
for (let i = 0; i < this.shimGenerators.length; i++) {
|
||||
const generator = this.shimGenerators[i];
|
||||
const originalFile = generator.getOriginalSourceOfShim(canonical);
|
||||
const originalFile = generator.getOriginalSourceOfShim(fileName);
|
||||
if (originalFile !== null) {
|
||||
// This shim generator has recognized the filename being requested, and is now responsible
|
||||
// for generating its contents, based on the contents of the original file it has requested.
|
||||
|
||||
Reference in New Issue
Block a user