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
10 changes: 5 additions & 5 deletions 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, config = {}, **kwargs):
def spec_bundle(name, deps, srcs = [], bootstrap = [], testonly = True, config = {}, **kwargs):
spec_entrypoint(
name = "%s_entrypoint" % name,
deps = deps,
Expand All @@ -13,7 +13,7 @@ def spec_bundle(name, deps, bootstrap = [], testonly = True, config = {}, **kwar
name = name,
# Note: `deps` are added here to automatically collect transitive NPM
# sources etc. and make them available for bundling.
srcs = deps + [
srcs = srcs + deps + [
":%s_entrypoint" % name,
],
config = dict({
Expand All @@ -38,15 +38,15 @@ def spec_bundle(name, deps, bootstrap = [], testonly = True, config = {}, **kwar
**kwargs
)

def spec_bundle_amd(name, workspace_name, **kwargs):
def spec_bundle_amd(name, workspace_name, config = {}, **kwargs):
amd_name = "%s/%s/%s" % (workspace_name, native.package_name(), name + ".spec")

spec_bundle(
name,
config = {
config = dict({
"globalName": "__exports",
"banner": {"js": "define(\"%s\", [], function() {" % amd_name},
"footer": {"js": "return __exports;})"},
},
}, **config),
**kwargs
)