Skip to content

Commit f78a2b8

Browse files
committed
fix(typescript): include workspace name in relativize helper
1 parent 20c5c58 commit f78a2b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/typescript/internal/tslib.bzl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ def _join(*elements):
66
return "/".join(segments)
77
return "."
88

9+
def _strip_external(path):
10+
return path[len("external/"):] if path.startswith("external/") else path
11+
912
def _relative_to_package(path, ctx):
10-
for prefix in (ctx.bin_dir.path, ctx.label.package):
13+
for prefix in [ctx.bin_dir.path, ctx.label.workspace_name, ctx.label.package]:
1114
prefix += "/"
15+
path = _strip_external(path)
1216
if path.startswith(prefix):
1317
path = path[len(prefix):]
1418
return path
@@ -31,7 +35,6 @@ def _replace_ext(f, ext_map):
3135
return new_ext
3236
return None
3337

34-
3538
def _out_paths(srcs, out_dir, root_dir, allow_js, ext_map):
3639
rootdir_replace_pattern = root_dir + "/" if root_dir else ""
3740
outs = []

0 commit comments

Comments
 (0)