Skip to content

Commit 1c50e96

Browse files
authored
fix(typescript): output path for .json in root package (#2602)
Fixes #2598
1 parent 9b5712c commit 1c50e96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/typescript/internal/ts_project.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ def _ts_project_impl(ctx):
170170
# NB: We don't have emit_declaration_only setting here, so use presence of any JS outputs as an equivalent.
171171
# tsc will only produce .json if it also produces .js
172172
if len(ctx.outputs.js_outs):
173+
pkg_len = len(ctx.label.package) + 1 if len(ctx.label.package) else 0
173174
json_outs = [
174-
ctx.actions.declare_file(_join(ctx.attr.out_dir, src.short_path[len(ctx.label.package) + 1:]))
175+
ctx.actions.declare_file(_join(ctx.attr.out_dir, src.short_path[pkg_len:]))
175176
for src in ctx.files.srcs
176177
if src.basename.endswith(".json")
177178
]

0 commit comments

Comments
 (0)