fix(ivy): correct ngtsc path handling in Windows (#26703)
As it turns out, the usage of path.posix does not unify path handling across operating systems. Instead, canonical-path is used to ensure path handling is consistent, avoiding incorrect paths in Windows. See https://github.com/angular/angular/pull/25862#discussion_r216157914 PR Close #26703
This commit is contained in:
@ -10,6 +10,7 @@ ts_library(
|
||||
]),
|
||||
deps = [
|
||||
"//packages:types",
|
||||
"@ngdeps//canonical-path",
|
||||
"@ngdeps//typescript",
|
||||
],
|
||||
)
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
///<reference types="jasmine"/>
|
||||
|
||||
import * as path from 'path';
|
||||
import * as path from 'canonical-path';
|
||||
import * as ts from 'typescript';
|
||||
|
||||
export function makeProgram(
|
||||
@ -93,7 +93,7 @@ export class InMemoryHost implements ts.CompilerHost {
|
||||
}
|
||||
|
||||
getCanonicalFileName(fileName: string): string {
|
||||
return path.posix.normalize(`${this.getCurrentDirectory()}/${fileName}`);
|
||||
return path.normalize(`${this.getCurrentDirectory()}/${fileName}`);
|
||||
}
|
||||
|
||||
useCaseSensitiveFileNames(): boolean { return true; }
|
||||
|
Reference in New Issue
Block a user