forked from angular/angular
-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathBUILD.bazel
123 lines (110 loc) · 3.24 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
load("@aspect_bazel_lib//lib:copy_to_directory.bzl", "copy_to_directory")
load("@build_bazel_rules_nodejs//:index.bzl", "pkg_web")
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary")
load("//devtools/tools:ng_module.bzl", "ng_module")
load("//devtools/tools/esbuild:index.bzl", "LINKER_PROCESSED_FW_PACKAGES")
load("//tools:defaults.bzl", "esbuild", "http_server")
package(default_visibility = ["//visibility:public"])
sass_binary(
name = "demo_styles",
src = "styles.scss",
include_paths = ["external/npm/node_modules"],
sourcemap = False,
deps = ["//devtools/projects/ng-devtools/src/styles:global"],
)
copy_to_directory(
name = "browser_specific_styles",
srcs = [
"//devtools/projects/ng-devtools/src/styles:chrome",
"//devtools/projects/ng-devtools/src/styles:firefox",
],
out = "styles",
replace_prefixes = {
"devtools/projects/ng-devtools/src/styles": "",
},
)
ng_module(
name = "demo",
srcs = ["main.ts"],
deps = [
"//devtools/src/app",
"//packages/common",
"//packages/common/http",
"//packages/core",
"//packages/core/src/util",
"//packages/platform-browser",
"@npm//@types",
"@npm//rxjs",
],
)
esbuild(
name = "bundle",
config = "//devtools/tools/esbuild:esbuild_config_esm",
entry_points = [":main.ts"],
platform = "browser",
splitting = True,
# todo(aleksanderbodurri): here we target es2020 explicitly.
# We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change
# to how angular static properties are attached to class constructors.
# Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class
# constructors to reference a class constructor variable that they do not have access to.
target = "es2020",
deps = LINKER_PROCESSED_FW_PACKAGES + [":demo"],
)
exports_files(["index.html"])
filegroup(
name = "dev_app_static_files",
srcs = [
":browser_specific_styles",
":demo_styles",
":index.html",
"//packages/zone.js/bundles:zone.umd.js",
],
)
pkg_web(
name = "devapp",
srcs = [":dev_app_static_files"] + [
":bundle",
"@npm//:node_modules/tslib/tslib.js",
],
)
http_server(
name = "devserver",
srcs = [":dev_app_static_files"],
additional_root_paths = ["angular/devtools/src/devapp"],
tags = ["manual"],
deps = [
":devapp",
],
)
ng_module(
name = "demo_application_environment",
srcs = ["demo-application-environment.ts"],
deps = [
"//devtools/projects/ng-devtools",
"//devtools/src/environments",
],
)
ng_module(
name = "demo_application_operations",
srcs = ["demo-application-operations.ts"],
deps = [
"//devtools/projects/ng-devtools",
"//devtools/projects/protocol",
],
)
ng_module(
name = "iframe_message_bus",
srcs = ["iframe-message-bus.ts"],
deps = [
"//devtools/projects/protocol",
],
)
ng_module(
name = "zone-unaware-iframe_message_bus",
srcs = ["zone-unaware-iframe-message-bus.ts"],
deps = [
":iframe_message_bus",
"//devtools/projects/protocol",
],
)