support expanding locations in esbuild arguments

This commit is contained in:
Damien Elmes 2021-03-28 09:35:27 +10:00
parent 5160d0c418
commit 944528d462

View file

@ -101,7 +101,7 @@ def _esbuild_impl(ctx):
args.add_joined(["--tsconfig", jsconfig_file.path], join_with = "=")
inputs.append(jsconfig_file)
args.add_all(ctx.attr.args)
args.add_all([ctx.expand_location(arg) for arg in ctx.attr.args])
ctx.actions.run(
inputs = inputs,
@ -122,7 +122,8 @@ esbuild = rule(
attrs = {
"args": attr.string_list(
default = [],
doc = "A list of extra arguments that are included in the call to esbuild",
doc = """A list of extra arguments that are included in the call to esbuild.
$(location ...) can be used to resolve the path to a Bazel target.""",
),
"define": attr.string_list(
default = [],