Skip to content

Commit

Permalink
fix(typescript): output path for .json in root package (#2602)
Browse files Browse the repository at this point in the history
Fixes #2598
  • Loading branch information
alexeagle authored Apr 10, 2021
1 parent 9b5712c commit 1c50e96
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/typescript/internal/ts_project.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ def _ts_project_impl(ctx):
# NB: We don't have emit_declaration_only setting here, so use presence of any JS outputs as an equivalent.
# tsc will only produce .json if it also produces .js
if len(ctx.outputs.js_outs):
pkg_len = len(ctx.label.package) + 1 if len(ctx.label.package) else 0
json_outs = [
ctx.actions.declare_file(_join(ctx.attr.out_dir, src.short_path[len(ctx.label.package) + 1:]))
ctx.actions.declare_file(_join(ctx.attr.out_dir, src.short_path[pkg_len:]))
for src in ctx.files.srcs
if src.basename.endswith(".json")
]
Expand Down

0 comments on commit 1c50e96

Please sign in to comment.