angular/packages/service-worker/worker/BUILD.bazel
Joey Perrott 9a27c5befb build: rename defaults2.bzl to defaults.bzl (#63384)
Use defaults.bzl for the common macros

PR Close #63384
2025-08-25 15:45:46 -07:00

37 lines
901 B
Text

load("@aspect_rules_esbuild//esbuild:defs.bzl", "esbuild")
load("//tools:defaults.bzl", "ts_project")
package(default_visibility = ["//visibility:public"])
ts_project(
name = "worker",
srcs = glob(
[
"*.ts",
"src/**/*.ts",
],
exclude = [
"main.ts",
],
),
)
ts_project(
name = "main",
srcs = ["main.ts"],
deps = [":worker"],
)
esbuild(
name = "ngsw_worker",
entry_point = ":main.ts",
format = "iife",
platform = "browser",
# All the browsers supported by Angular support `ES2017`, so we can ship the worker bundle with
# target of `ES2017`. Technically even ES2020 can work since the worker does not use any of the
# features that are unavailable in some supported browsers. This is risky though, so we keep ES2017.
target = "es2017",
deps = [
":main",
],
)