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(
|
git_repository(
|
||||||
name = "build_bazel_rules_typescript",
|
name = "build_bazel_rules_typescript",
|
||||||
remote = "https://github.com/bazelbuild/rules_typescript.git",
|
remote = "https://github.com/bazelbuild/rules_typescript.git",
|
||||||
# tag = "0.7.1+",
|
commit = "c4ea003acd7d42269b81a2d25eb832972cd24912"
|
||||||
commit = "89d2c75066bea3d9c942f29dd1d2ea543c58d6d5"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@build_bazel_rules_typescript//:setup.bzl", "ts_setup_workspace")
|
load("@build_bazel_rules_typescript//:setup.bzl", "ts_setup_workspace")
|
||||||
|
@ -14,8 +14,7 @@ node_repositories(package_json = ["//:package.json"])
|
|||||||
git_repository(
|
git_repository(
|
||||||
name = "build_bazel_rules_typescript",
|
name = "build_bazel_rules_typescript",
|
||||||
remote = "https://github.com/bazelbuild/rules_typescript.git",
|
remote = "https://github.com/bazelbuild/rules_typescript.git",
|
||||||
# tag = "0.6.0",
|
commit = "c4ea003acd7d42269b81a2d25eb832972cd24912"
|
||||||
commit = "89d2c75066bea3d9c942f29dd1d2ea543c58d6d5"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
load("@build_bazel_rules_typescript//:setup.bzl", "ts_setup_workspace")
|
load("@build_bazel_rules_typescript//:setup.bzl", "ts_setup_workspace")
|
||||||
|
@ -189,15 +189,18 @@ export function compile({allowNonHermeticReads, allDepsCompiledWithBazel = true,
|
|||||||
}
|
}
|
||||||
return bazelOpts.workspaceName + '/' + result;
|
return bazelOpts.workspaceName + '/' + result;
|
||||||
};
|
};
|
||||||
ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) =>
|
ngHost.toSummaryFileName = (fileName: string, referringSrcFileName: string) => path.join(
|
||||||
relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, '');
|
bazelOpts.workspaceName,
|
||||||
|
relativeToRootDirs(fileName, compilerOpts.rootDirs).replace(EXT, ''));
|
||||||
if (allDepsCompiledWithBazel) {
|
if (allDepsCompiledWithBazel) {
|
||||||
// Note: The default implementation would work as well,
|
// Note: The default implementation would work as well,
|
||||||
// but we can be faster as we know how `toSummaryFileName` works.
|
// 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,
|
// 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
|
// as that has a different implementation of fromSummaryFileName / toSummaryFileName
|
||||||
ngHost.fromSummaryFileName = (fileName: string, referringLibFileName: string) =>
|
ngHost.fromSummaryFileName = (fileName: string, referringLibFileName: string) => {
|
||||||
path.resolve(bazelBin, fileName) + '.d.ts';
|
const workspaceRelative = fileName.split('/').splice(1).join('/');
|
||||||
|
return path.resolve(bazelBin, workspaceRelative) + '.d.ts';
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const emitCallback: ng.TsEmitCallback = ({
|
const emitCallback: ng.TsEmitCallback = ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user