11load ("@aspect_rules_esbuild//esbuild:defs.bzl" , "esbuild" )
22load ("@devinfra//bazel/spec-bundling:spec-entrypoint.bzl" , "spec_entrypoint" )
33
4- def spec_bundle (name , deps , bootstrap = [], testonly = True , config = {}, ** kwargs ):
4+ def spec_bundle (name , deps , srcs = [], bootstrap = [], testonly = True , config = {}, ** kwargs ):
55 spec_entrypoint (
66 name = "%s_entrypoint" % name ,
77 deps = deps ,
@@ -13,7 +13,7 @@ def spec_bundle(name, deps, bootstrap = [], testonly = True, config = {}, **kwar
1313 name = name ,
1414 # Note: `deps` are added here to automatically collect transitive NPM
1515 # sources etc. and make them available for bundling.
16- srcs = deps + [
16+ srcs = srcs + deps + [
1717 ":%s_entrypoint" % name ,
1818 ],
1919 config = dict ({
@@ -38,15 +38,15 @@ def spec_bundle(name, deps, bootstrap = [], testonly = True, config = {}, **kwar
3838 ** kwargs
3939 )
4040
41- def spec_bundle_amd (name , workspace_name , ** kwargs ):
41+ def spec_bundle_amd (name , workspace_name , config = {}, ** kwargs ):
4242 amd_name = "%s/%s/%s" % (workspace_name , native .package_name (), name + ".spec" )
4343
4444 spec_bundle (
4545 name ,
46- config = {
46+ config = dict ( {
4747 "globalName" : "__exports" ,
4848 "banner" : {"js" : "define(\" %s\" , [], function() {" % amd_name },
4949 "footer" : {"js" : "return __exports;})" },
50- },
50+ }, ** config ),
5151 ** kwargs
5252 )
0 commit comments