build: Update to latest rules_typescript. (#21675)

Fixes #21481

PR Close #21675
This commit is contained in:
Alex Eagle
2018-01-19 13:32:39 -08:00
committed by Miško Hevery
parent c12ea3a1f0
commit 4b68fdce6f
3 changed files with 9 additions and 8 deletions

View File

@ -189,15 +189,18 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
}
return bazelOpts.workspaceName + '/' + result;
};
ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) =>
relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, '');
ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) => path.join(
bazelOpts.workspaceName,
relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, ''));
if (allDepsCompiledWithBazel) {
// Note: The default implementation would work as well,
// but we can be faster as we know how `toSummaryFileName` works.
// Note: We can't do this if some deps have been compiled with the command line,
// as that has a different implementation of fromSummaryFileName / toSummaryFileName
ngHost.fromSummaryFileName = (fileName: string, referringLibFileName: string) =>
path.resolve(bazelBin, fileName) + '.d.ts';
ngHost.fromSummaryFileName = (fileName: string, referringLibFileName: string) => {
const workspaceRelative = fileName.split('/').splice(1).join('/');
return path.resolve(bazelBin, workspaceRelative) + '.d.ts';
};
}
const emitCallback: ng.TsEmitCallback = ({