angular/.github/actions/deploy-docs-site/BUILD.bazel
Alan Agius 37e1edaf7f build: mark pnpapi as external for esbuild (#63723)
In the `deploy-docs-site` GitHub action, esbuild fails to resolve `pnpapi` during the bundling process. This is because `pnpapi` is a dependency that is available in the Node.js environment at runtime and should not be bundled.

This commit marks `pnpapi` as an external dependency for esbuild to prevent it from being bundled and resolve the build failure.

```
✘ [ERROR] Could not resolve "pnpapi" [plugin bazel-sandbox]
```

See: https://github.com/angular/angular/pull/63722#issuecomment-3278922553

PR Close #63723
2025-09-11 15:36:34 +00:00

42 lines
890 B
Text

load("//tools:defaults.bzl", "esbuild_checked_in", "ts_config", "ts_project")
package(default_visibility = ["//.github/actions/deploy-docs-site:__subpackages__"])
exports_files([
"tsconfig.json",
])
esbuild_checked_in(
name = "main",
config = "esbuild.conf.js",
entry_point = ":lib/main.mts",
external = [
"undici",
"pnpapi",
],
metafile = False,
platform = "node",
target = "node20",
deps = [
":lib",
],
)
ts_config(
name = "tsconfig",
src = "tsconfig.json",
)
ts_project(
name = "lib",
srcs = glob(["lib/*.mts"]),
tsconfig = ":tsconfig",
deps = [
"//:node_modules/@actions/core",
"//:node_modules/@actions/github",
"//:node_modules/@angular/ng-dev",
"//:node_modules/@types/node",
"//:node_modules/@types/tmp",
"//:node_modules/tmp",
],
)