@@ -4,7 +4,7 @@ esbuild rule
44
55load ("@build_bazel_rules_nodejs//:providers.bzl" , "JSEcmaScriptModuleInfo" , "JSModuleInfo" , "NpmPackageInfo" , "node_modules_aspect" )
66load ("@build_bazel_rules_nodejs//internal/linker:link_node_modules.bzl" , "MODULE_MAPPINGS_ASPECT_RESULTS_NAME" , "module_mappings_aspect" )
7- load (":helpers.bzl" , "filter_files" , "generate_path_mapping" , "resolve_js_input " , "write_jsconfig_file" )
7+ load (":helpers.bzl" , "filter_files" , "generate_path_mapping" , "resolve_entry_point " , "write_jsconfig_file" )
88
99def _esbuild_impl (ctx ):
1010 # For each dep, JSEcmaScriptModuleInfo is used if found, then JSModuleInfo and finally
@@ -47,12 +47,12 @@ def _esbuild_impl(ctx):
4747 path_alias_mappings .update ({"*" : node_modules_mappings })
4848
4949 deps_inputs = depset (transitive = deps_depsets ).to_list ()
50- inputs = filter_files (ctx .files .entry_point , [ ".mjs" , ".js" ] ) + ctx .files .srcs + deps_inputs
50+ inputs = filter_files (ctx .files .entry_point ) + ctx .files .srcs + deps_inputs
5151
5252 metafile = ctx .actions .declare_file ("%s_metadata.json" % ctx .attr .name )
5353 outputs = [metafile ]
5454
55- entry_point = resolve_js_input (ctx .file .entry_point , inputs )
55+ entry_point = resolve_entry_point (ctx .file .entry_point , inputs , ctx . files . srcs )
5656
5757 args = ctx .actions .args ()
5858
@@ -126,7 +126,7 @@ def _esbuild_impl(ctx):
126126 execution_requirements = {"no-remote-exec" : "1" }
127127
128128 ctx .actions .run (
129- inputs = inputs ,
129+ inputs = depset ( inputs ) ,
130130 outputs = outputs ,
131131 executable = ctx .executable .tool ,
132132 arguments = [args ],
@@ -260,9 +260,7 @@ See https://esbuild.github.io/api/#sources-content for more details
260260 "srcs" : attr .label_list (
261261 allow_files = True ,
262262 default = [],
263- doc = """Non-entry point JavaScript source files from the workspace.
264-
265- You must not repeat file(s) passed to entry_point""" ,
263+ doc = """Source files to be made available to esbuild""" ,
266264 ),
267265 "target" : attr .string (
268266 default = "es2015" ,
0 commit comments