-
Notifications
You must be signed in to change notification settings - Fork 6.8k
/
Copy pathBUILD.bazel
95 lines (86 loc) · 2.16 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
load("@aspect_bazel_lib//lib:copy_to_bin.bzl", "copy_to_bin")
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_library", "js_test")
load("@npm2//:defs.bzl", "npm_link_all_packages")
load("//docs:defs.bzl", "ng_app")
package(default_visibility = ["//visibility:public"])
# Link npm packages
npm_link_all_packages(name = "node_modules")
# Root config files used throughout build/test/lint etc
copy_to_bin(
name = "ng-base-config",
srcs = [
"angular.json",
"package.json",
"tsconfig.json",
],
)
# Test config files
copy_to_bin(
name = "ng-base-test-config",
srcs = [
"karma-custom-launchers.js",
],
)
# Lint config files
copy_to_bin(
name = "ng-base-lint-config",
srcs = [
".eslintrc.json",
],
)
# The main application
ng_app(
name = "app",
project_name = "material-angular-io",
deps = [
"//docs:node_modules/@angular/components-examples",
"//docs:node_modules/@stackblitz/sdk",
"//docs:node_modules/moment",
"//docs:node_modules/path-normalize",
"//src/material:tokens",
],
)
js_library(
name = "audit_lib",
srcs = [
"tools/audit-docs.js",
"tools/lighthouse-audit.mjs",
],
data = [
"//docs:node_modules/light-server",
"//docs:node_modules/lighthouse",
"//docs:node_modules/lighthouse-logger",
"//docs:node_modules/puppeteer-core",
"//docs:node_modules/shelljs",
"@rules_browsers//src/browsers/chromium",
],
)
js_binary(
name = "audit_tool",
data = [":audit_lib"],
entry_point = "tools/audit-docs.js",
env = {
"CHROMIUM_BIN": "$(CHROME-HEADLESS-SHELL)",
},
toolchains = [
"@rules_browsers//src/browsers/chromium:toolchain_alias",
],
)
js_test(
name = "audit",
args = [
"$(location //docs:build.production)",
],
data = [
":audit_lib",
"//docs:build.production",
],
entry_point = "tools/audit-docs.js",
env = {
"CHROMIUM_BIN": "$(CHROME-HEADLESS-SHELL)",
},
tags = ["audit"],
toolchains = [
"@rules_browsers//src/browsers/chromium:toolchain_alias",
],
)