build: Update to latest rules_typescript. (#21675)
Fixes #21481 PR Close #21675
This commit is contained in:
parent
c12ea3a1f0
commit
4b68fdce6f
@ -16,8 +16,7 @@ node_repositories(package_json = ["//:package.json"])
|
||||
git_repository(
|
||||
name = "build_bazel_rules_typescript",
|
||||
remote = "https://github.com/bazelbuild/rules_typescript.git",
|
||||
# tag = "0.7.1+",
|
||||
commit = "89d2c75066bea3d9c942f29dd1d2ea543c58d6d5"
|
||||
commit = "c4ea003acd7d42269b81a2d25eb832972cd24912"
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_typescript//:setup.bzl", "ts_setup_workspace")
|
||||
|
@ -14,8 +14,7 @@ node_repositories(package_json = ["//:package.json"])
|
||||
git_repository(
|
||||
name = "build_bazel_rules_typescript",
|
||||
remote = "https://github.com/bazelbuild/rules_typescript.git",
|
||||
# tag = "0.6.0",
|
||||
commit = "89d2c75066bea3d9c942f29dd1d2ea543c58d6d5"
|
||||
commit = "c4ea003acd7d42269b81a2d25eb832972cd24912"
|
||||
)
|
||||
|
||||
load("@build_bazel_rules_typescript//:setup.bzl", "ts_setup_workspace")
|
||||
|
@ -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 = ({
|
||||
|
Loading…
x
Reference in New Issue
Block a user