/
BUILD.bazel
65 lines (59 loc) 路 1.67 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
package(default_visibility = ["//visibility:public"])
load("@npm_bazel_karma//:index.bzl", "karma_web_test_suite")
load("@npm_bazel_typescript//:index.bzl", "ts_library")
load("@io_bazel_rules_sass//sass:sass.bzl", "sass_binary")
load("@npm_angular_bazel//:index.bzl", "ng_module", "ng_package")
sass_binary(
name = "hello-world-styles",
src = "hello-world.component.scss",
)
ng_module(
name = "hello-world",
srcs = glob(
["*.ts"],
exclude = ["*.spec.ts"],
),
assets = [":hello-world-styles"],
generate_ve_shims = True,
deps = [
"@npm//@angular/core",
"@npm//@types",
],
)
ng_package(
name = "npm_package",
entry_point = ":index.ts",
deps = [":hello-world"],
)
ts_library(
name = "test_lib",
testonly = 1,
srcs = glob(["*.spec.ts"]),
deps = [
":hello-world",
"@npm//@angular/core",
"@npm//@angular/platform-browser",
"@npm//@angular/platform-browser-dynamic",
"@npm//@types",
"@npm//jasmine",
],
)
karma_web_test_suite(
name = "test",
bootstrap = [
"@npm//:node_modules/zone.js/dist/zone-testing-bundle.js",
"@npm//:node_modules/reflect-metadata/Reflect.js",
],
browsers = [
"@io_bazel_rules_webtesting//browsers:chromium-local",
# TODO(gregmagolan): re-enable firefox testing once fixed
# See https://github.com/bazelbuild/rules_typescript/issues/296
# "@io_bazel_rules_webtesting//browsers:firefox-local",
],
# rules_webtesting has a required_tag "native" for `chromium-local` browser
tags = ["native"],
deps = [
":test_lib",
"//src:rxjs_umd_modules",
],
)