build: fix api guardian path for windows (#26888)
At the moment, `path.posix.relative` will break paths in windows as it will return something like ``` Error: Source file "../C:/users/alag/_bazel_alag/3tbqurya/execroot/angular/bazel-out/x64_windows-fastbuild/bin/packages/core/core.d.ts" not found ``` PR Close #26888
This commit is contained in:
parent
efa443bba3
commit
7865abf667
|
@ -191,7 +191,7 @@ function resolveBazelFilePath(fileName: string): string {
|
||||||
// are not available in the working directory. In order to resolve the real path for the
|
// are not available in the working directory. In order to resolve the real path for the
|
||||||
// runfile, we need to use `require.resolve` which handles runfiles properly on Windows.
|
// runfile, we need to use `require.resolve` which handles runfiles properly on Windows.
|
||||||
if (process.env['BAZEL_TARGET']) {
|
if (process.env['BAZEL_TARGET']) {
|
||||||
return path.posix.relative(process.cwd(), require.resolve(fileName));
|
return path.relative(process.cwd(), require.resolve(fileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileName;
|
return fileName;
|
||||||
|
|
Loading…
Reference in New Issue