Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion bazel/spec-bundling/index_rjs.bzl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("@devinfra//bazel/spec-bundling:spec-entrypoint.bzl", "spec_entrypoint")

def spec_bundle(name, deps, bootstrap = [], testonly = True, **kwargs):
def spec_bundle(name, deps, bootstrap = [], testonly = True, config = {}, **kwargs):
spec_entrypoint(
name = "%s_entrypoint" % name,
deps = deps,
Expand All @@ -16,6 +16,17 @@ def spec_bundle(name, deps, bootstrap = [], testonly = True, **kwargs):
srcs = deps + [
":%s_entrypoint" % name,
],
config = dict({
# Bundling specs may result in classes being aliased to avoid collisions. e.g. when
# everything is bundled into a single AMD bundle. To avoid test failures for assertions
# on symbol names, we instruct ESBuild to keep original names. See:
# https://esbuild.github.io/api/#keep-names.
"keepNames": True,
# Needed for ZoneJS async await
"supported": {
"async-await": False,
},
}, **config),
testonly = testonly,
bundle = True,
format = "iife",
Expand Down