Skip to content

Commit

Permalink
fix(typescript): include workspace name in relativize helper
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Feb 2, 2022
1 parent 20c5c58 commit f78a2b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/typescript/internal/tslib.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ def _join(*elements):
return "/".join(segments)
return "."

def _strip_external(path):
return path[len("external/"):] if path.startswith("external/") else path

def _relative_to_package(path, ctx):
for prefix in (ctx.bin_dir.path, ctx.label.package):
for prefix in [ctx.bin_dir.path, ctx.label.workspace_name, ctx.label.package]:
prefix += "/"
path = _strip_external(path)
if path.startswith(prefix):
path = path[len(prefix):]
return path
Expand All @@ -31,7 +35,6 @@ def _replace_ext(f, ext_map):
return new_ext
return None


def _out_paths(srcs, out_dir, root_dir, allow_js, ext_map):
rootdir_replace_pattern = root_dir + "/" if root_dir else ""
outs = []
Expand Down

0 comments on commit f78a2b8

Please sign in to comment.