-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
BUILD.bazel
58 lines (52 loc) 路 1.42 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
load("//tools:defaults.bzl", "ng_module", "ng_package", "npm_package")
package(default_visibility = ["//packages/bazel/test:__subpackages__"])
ng_module(
name = "example",
srcs = glob(["*.ts"]),
module_name = "example",
deps = [
"//packages/bazel/test/ng_package/example/secondary",
"@npm//@types",
],
)
ng_package(
name = "npm_package",
srcs = [
"package.json",
"some-file.txt",
],
data = [
":arbitrary_bin_file",
":arbitrary_genfiles_file",
":extra-styles.css",
":logo.png",
],
entry_point = ":index.ts",
entry_point_name = "waffels",
packages = [
":arbitrary_npm_package",
],
deps = [
":example",
"//packages/bazel/test/ng_package/example/secondary",
],
)
# Use a genrule to create a file in bazel-genfiles to ensure that the genfiles output of
# a rule can be passed through to the `data` of ng_package.
genrule(
name = "arbitrary_genfiles_file",
outs = ["arbitrary_genfiles.txt"],
cmd = "echo Hello > $@",
)
# Use a genrule to create a file in bazel-bin to ensure that the bin output of
# a rule can be passed through to the `data` of ng_package.
genrule(
name = "arbitrary_bin_file",
outs = ["arbitrary_bin.txt"],
cmd = "echo World > $@",
output_to_bindir = True,
)
npm_package(
name = "arbitrary_npm_package",
srcs = [":arbitrary-npm-package-main.js"],
)