fix(compiler-cli): Use typescript to resolve modules for metadata (#22856)
The current module resolution simply attaches .ts to the import/export path, which does not work if the path is using Node / CommonJS behavior to resolve to an index.ts file. This patch uses typescript's module resolution logic, and will attempt to load the original typescript file if this resolution returns a .js or .d.ts file PR Close #22856
This commit is contained in:
@ -19,7 +19,9 @@ export class MockAotContext {
|
||||
|
||||
fileExists(fileName: string): boolean { return typeof this.getEntry(fileName) === 'string'; }
|
||||
|
||||
directoryExists(path: string): boolean { return typeof this.getEntry(path) === 'object'; }
|
||||
directoryExists(path: string): boolean {
|
||||
return path === this.currentDirectory || typeof this.getEntry(path) === 'object';
|
||||
}
|
||||
|
||||
readFile(fileName: string): string {
|
||||
const data = this.getEntry(fileName);
|
||||
|
Reference in New Issue
Block a user