angular/dev-app/BUILD.bazel
Matthieu Riegler 35fd8b567a build: use different default port for dev-app
Same as ADEV, currently the CLI prompts for another port if 4200 is busy but the toolchain doesn't support prompts.

By defaulting to 4201 we avoid regular CLI apps from preventing to run the dev-app

(cherry picked from commit 9bb4f02bef)
2026-02-27 17:04:19 +00:00

81 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",
serve_args = [
"--port",
"4201",
],
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",
)