angular/dev-app/BUILD.bazel
Alan Agius 5a38aed388 build: move NG_FORCE_TTY environment variable
This moved the `NG_FORCE_TTY` from individual `ng_web_app` rules to a global Bazel build flag as this is also needed for integration tests that under the hood run `ng serve` .
2025-12-08 09:12:39 -08:00

77 lines
1.8 KiB
Text

load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_angular//src/architect:ng_application.bzl", "ng_application")
load("@rules_angular//src/architect:ng_config.bzl", "ng_config")
load("@rules_angular//src/architect:ng_test.bzl", "ng_test")
package(default_visibility = ["//visibility:public"])
npm_link_all_packages(
name = "node_modules",
)
APPLICATION_FILES = [
"//dev-app/public",
] + glob(
["src/**/*"],
exclude = ["src/**/*.spec.ts"],
)
APPLICATION_DEPS = [
":node_modules/typescript",
]
TEST_FILES = APPLICATION_FILES + glob(["src/app/**/*.spec.ts"])
TEST_DEPS = APPLICATION_DEPS + [
":node_modules/jsdom",
":node_modules/vitest",
":tsconfig.app.json",
]
ng_config(name = "ng_config")
ng_application(
name = "build",
srcs = APPLICATION_FILES + APPLICATION_DEPS,
args = [
"--configuration",
"development",
],
env = {
"NG_BUILD_PARTIAL_SSR": "1",
},
ng_config = ":ng_config",
node_modules = ":node_modules",
project_name = "dev-app",
tags = [
# Tagged as manual as both build and build.production use the same output directory.
"manual",
],
)
ng_application(
name = "build.production",
srcs = APPLICATION_FILES + APPLICATION_DEPS,
args = [
"--configuration",
"production",
],
env = {
"NG_BUILD_OPTIMIZE_CHUNKS": "1",
},
ng_config = ":ng_config",
node_modules = ":node_modules",
project_name = "dev-app",
tags = [
# Tagged as manual as both build and build.production use the same output directory.
"manual",
],
)
ng_test(
name = "test",
srcs = TEST_FILES + TEST_DEPS,
ng_config = ":ng_config",
node_modules = ":node_modules",
project_name = "dev-app",
)