Skip to content

Commit

Permalink
fix(builtin): allow .tsx entry_point in node binary/test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Nov 18, 2019
1 parent be7232e commit d0d60eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions internal/node/node.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def _write_loader_script(ctx):
# point to the corresponding .js file
if entry_point_path.endswith(".ts"):
entry_point_path = entry_point_path[:-3] + ".js"
elif entry_point_path.endswith(".tsx"):
entry_point_path = entry_point_path[:-4] + ".jsx"

ctx.actions.expand_template(
template = ctx.file._loader_template,
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/src/internal/build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _filter_ts_inputs(all_inputs):
return [
f
for f in all_inputs
if f.path.endswith(".js") or f.path.endswith(".ts") or f.path.endswith(".json")
if f.extension in ["js", "jsx", "ts", "tsx", "json"]
]

def _compile_action(ctx, inputs, outputs, tsconfig_file, node_opts, description = "prodmode"):
Expand Down

0 comments on commit d0d60eb

Please sign in to comment.