anki/ts/esbuild.bzl
2022-04-05 09:53:36 +10:00

24 lines
572 B
Python

load("@npm//@bazel/esbuild:index.bzl", _esbuild = "esbuild")
def esbuild(name, **kwargs):
args = kwargs.get("args", {})
if "resolveExtension" not in args:
args["resolveExtensions"] = [
".mjs",
".js",
]
if "logLevel" not in args:
args["logLevel"] = "warning"
kwargs["args"] = args
_esbuild(
name = name,
minify = select({
"//:release": True,
"//conditions:default": False,
}),
# support Qt 5.14
target = "chrome77",
**kwargs
)