mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 14:31:56 +00:00
Sandbox escapes be-gone ## Test plan Tested in CI and locally with `bazel build //client/...` as well as a lot of blood, sweat n tears tearing through failed sandboxes ## Changelog
26 lines
729 B
Python
26 lines
729 B
Python
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
|
|
load("@aspect_rules_esbuild//esbuild:defs.bzl", _esbuild = "esbuild")
|
|
|
|
def esbuild(name, **kwargs):
|
|
_esbuild(
|
|
name,
|
|
**kwargs
|
|
)
|
|
|
|
def esbuild_web_app(name, **kwargs):
|
|
bundle_name = "%s_bundle" % name
|
|
|
|
_esbuild(
|
|
name = bundle_name,
|
|
**kwargs
|
|
)
|
|
|
|
copy_to_directory(
|
|
name = name,
|
|
# flatten static assets
|
|
# https://docs.aspect.build/rules/aspect_bazel_lib/docs/copy_to_directory/#root_paths
|
|
root_paths = ["client/web/dist", "client/web/%s" % bundle_name],
|
|
srcs = ["//client/web/dist/img:img", ":%s" % bundle_name],
|
|
visibility = ["//visibility:public"],
|
|
)
|