angular/packages/platform-server/init/BUILD.bazel
Alan Agius 6b112cc621 refactor(platform-server): remove dependency between @angular/platform-server and @angular/platform-server/init (#52342)
Previously, the cross entry-point dependency was created to share the `setDomTypes` function. This however, causes extra transformations "linking" during the application build since other Angular code in `@angular/platform-server` is pulled in.

With this commit we remove the cross dependency and thus remove the need for extra transformations in the server polyfill bundle with the result of having a slightly faster build.

See: https://github.com/angular/angular-cli/pull/26113

PR Close #52342
2023-10-24 09:26:50 -07:00

48 lines
951 B
Text

load("@build_bazel_rules_nodejs//:index.bzl", "js_library")
load("//tools:defaults.bzl", "esbuild", "ng_module", "tsec_test")
package(default_visibility = ["//visibility:public"])
ng_module(
name = "init",
srcs = glob(
[
"*.ts",
"src/**/*.ts",
],
exclude = ["src/bundled-domino.d.ts"],
),
deps = [
":bundled_domino_lib",
],
)
esbuild(
name = "bundled_domino",
entry_point = "@npm//:node_modules/domino/lib/index.js",
format = "esm",
output = "src/bundled-domino.mjs",
deps = ["@npm//domino"],
)
js_library(
name = "bundled_domino_lib",
srcs = [
"src/bundled-domino.d.ts",
":bundled_domino",
],
)
tsec_test(
name = "tsec_test",
target = "init",
tsconfig = "//packages:tsec_config",
)
filegroup(
name = "files_for_docgen",
srcs = glob([
"*.ts",
"src/**/*.ts",
]) + ["PACKAGE.md"],
)