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:
Alan Agius 2018-11-01 11:48:18 +01:00 committed by Andrew Kushnir
parent efa443bba3
commit 7865abf667
1 changed files with 1 additions and 1 deletions

View File

@ -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;