/
githubmirror
/
angular
Обзор
Документация
Войти
/
githubmirror
/
angular
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tools/bazel/esbuild.bzl
38 строк
2 KB
Alan Agius
build: update `aspect_rules_js` to `3.0.2` (#67518)
11 мар 2026, 23:37
11 мар 2026, 23:37
4febb8a
Код
Авторство
О чём код?
load("@aspect_rules_esbuild//esbuild:defs.bzl", _esbuild = "esbuild") load("@bazel_lib//lib:write_source_files.bzl", "write_source_file") esbuild = _esbuild def esbuild_checked_in(name, **kwargs): esbuild( name = "%s_generated" % name, # Unfortunately we need to omit source maps from the checked-in files as these # will vary based on the platform. See more details below in the sanitization # genrule transformation. It is acceptable not having source-maps for the checked-in # files as those are not minified and its to debug, the checked-in file can be visited. sourcemap = "external", # We always disable minification for checked-in files as otherwise it will # become difficult determining potential differences. e.g. on Windows ESBuild # accidentally included `source-map-support` due to the missing sandbox. minify = False, output = "%s_generated.js" % name, **kwargs ) # ESBuild adds comments and function identifiers with the name of their module # location. e.g. `"bazel-out/x64_windows-fastbuild/bin/node_modules/a"function(exports)`. # We strip all of these paths as that would break approval of the he checked-in files within # different platforms (e.g. RBE running with K8). Additionally these paths depend # on the non-deterministic hoisting of the package manager across all platforms. native.genrule( name = "%s_sanitized" % name, srcs = ["%s_generated.js" % name], outs = ["%s_sanitized.js" % name], cmd = """cat $< | sed -E "s#(bazel-out|node_modules)/[^\\"']+##g" > $@""", ) write_source_file( name = name, out_file = "%s.js" % name, in_file = "%s_sanitized.js" % name, )