From 313d484865e0ea9c38ee3548a8014766be665053 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 18 Nov 2019 09:20:02 -0800 Subject: [PATCH] fix(builtin): allow .tsx entry_point in node binary/test Fixes #1351 --- internal/node/node.bzl | 2 ++ packages/typescript/src/internal/build_defs.bzl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/node/node.bzl b/internal/node/node.bzl index 921b757772..2ffe8355bb 100644 --- a/internal/node/node.bzl +++ b/internal/node/node.bzl @@ -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, diff --git a/packages/typescript/src/internal/build_defs.bzl b/packages/typescript/src/internal/build_defs.bzl index 97731442eb..e917f199d3 100644 --- a/packages/typescript/src/internal/build_defs.bzl +++ b/packages/typescript/src/internal/build_defs.bzl @@ -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"):