-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
BUILD.bazel
74 lines (64 loc) 路 1.73 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
package(default_visibility = ["//visibility:public"])
load("@angular//:index.bzl", "ng_module")
# 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",
"@angular//packages/common/http",
"@angular//packages/core",
"@angular//packages/platform-browser",
"@npm//@types",
"@npm//rxjs",
],
)
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")
ts_devserver(
name = "devserver",
additional_root_paths = [
"npm/node_modules/rxjs/bundles",
"npm/node_modules/tslib",
"npm/node_modules/zone.js/dist",
],
entry_module = "bazel_integration_test/src/main",
scripts = [
":require.config.js",
],
serving_path = "/bundle.js",
static_files = [
"@npm//node_modules/rxjs:bundles/rxjs.umd.js",
"@npm//node_modules/tslib:tslib.js",
"@npm//node_modules/zone.js:dist/zone.min.js",
":rxjs_operators_shim.js",
"index.html",
],
deps = ["//src"],
)
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "rollup_bundle")
rollup_bundle(
name = "bundle",
entry_point = "src/main",
deps = [
"//src",
"@npm//rxjs",
],
)
# Needed because the prodserver only loads static files that appear under this
# package.
genrule(
name = "zone.js",
srcs = ["@npm//node_modules/zone.js:dist/zone.min.js"],
outs = ["zone.min.js"],
cmd = "cp $< $@",
)
load("@build_bazel_rules_nodejs//:defs.bzl", "http_server")
http_server(
name = "prodserver",
data = [
"index.html",
":bundle.js",
":zone.js",
],
)