mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Brings in ts_library fixes required to get angular/angular building after 0.32.0: typescript: exclude typescript lib declarations in node_module_library transitive_declarations typescript: remove override of @bazel/tsetse (+1 squashed commit) @npm//node_modules/foobar:foobar.js labels changed to @npm//:node_modules/foobar/foobar.js with fix for bazelbuild/rules_nodejs#802 also updates to rules_rass commit compatible with rules_nodejs 0.32.0 PR Close #31325
80 lines
1.9 KiB
Text
80 lines
1.9 KiB
Text
package(default_visibility = ["//visibility:public"])
|
|
|
|
load("@npm_angular_bazel//:index.bzl", "ng_module")
|
|
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server", "rollup_bundle")
|
|
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
|
|
load("@npm_bazel_typescript//:index.bzl", "ts_devserver")
|
|
|
|
# Allow targets under sub-packages to reference the tsconfig.json file
|
|
exports_files(["tsconfig.json"])
|
|
|
|
ng_module(
|
|
name = "src",
|
|
srcs = glob(["*.ts"]),
|
|
deps = [
|
|
"//src/hello-world",
|
|
"@npm//@angular/common",
|
|
"@npm//@angular/core",
|
|
"@npm//@angular/platform-browser",
|
|
"@npm//@angular/router",
|
|
"@npm//@types",
|
|
"@npm//rxjs",
|
|
],
|
|
)
|
|
|
|
filegroup(
|
|
name = "rxjs_umd_modules",
|
|
srcs = [
|
|
# do not sort
|
|
"@npm//:node_modules/rxjs/bundles/rxjs.umd.js",
|
|
":rxjs_shims.js",
|
|
],
|
|
)
|
|
|
|
ts_devserver(
|
|
name = "devserver",
|
|
entry_module = "bazel_integration_test/src/main",
|
|
index_html = "index.html",
|
|
scripts = [
|
|
":rxjs_umd_modules",
|
|
],
|
|
serving_path = "/bundle.min.js",
|
|
static_files = [
|
|
"@npm//:node_modules/zone.js/dist/zone.min.js",
|
|
],
|
|
deps = ["//src"],
|
|
)
|
|
|
|
rollup_bundle(
|
|
name = "bundle",
|
|
entry_point = ":main.ts",
|
|
deps = [
|
|
"//src",
|
|
# TODO(kyliau): These are not necessary. Bundle compiles fine without
|
|
# these deps.
|
|
# "@npm//@angular/common",
|
|
# "@npm//@angular/core",
|
|
# "@npm//@angular/platform-browser",
|
|
"@npm//@angular/router", # needed here due to additional imports generated by ngc
|
|
"@npm//rxjs",
|
|
],
|
|
)
|
|
|
|
web_package(
|
|
name = "prodapp",
|
|
assets = [
|
|
# do not sort
|
|
"@npm//:node_modules/zone.js/dist/zone.min.js",
|
|
":bundle.min.js",
|
|
],
|
|
data = [
|
|
":bundle",
|
|
],
|
|
index_html = "index.html",
|
|
)
|
|
|
|
http_server(
|
|
name = "prodserver",
|
|
data = [":prodapp"],
|
|
templated_args = ["src/prodapp"],
|
|
)
|