-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
87 lines (78 loc) · 2.18 KB
/
BUILD.bazel
File metadata and controls
87 lines (78 loc) · 2.18 KB
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
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//:playwright/package_json.bzl", playwright_bin = "bin")
load("@npm//:vite/package_json.bzl", vite_bin = "bin")
load("@npm//:vitest/package_json.bzl", vitest_bin = "bin")
npm_link_all_packages()
ts_project(
name = "compile",
transpiler = "tsc",
no_emit = True,
srcs = glob([
"src/**/*.ts",
"src/**/*.tsx",
]),
deps = [
"//:node_modules/@testing-library/dom",
"//:node_modules/@testing-library/jest-dom",
"//:node_modules/@testing-library/react",
"//:node_modules/@types/react",
"//:node_modules/@types/react-dom",
"//:node_modules/react",
"//:node_modules/react-dom",
"//:node_modules/vite",
"//:node_modules/vitest",
],
)
vite_bin.vite(
name = "build",
srcs = [
":index.html",
":vite.config.ts",
"//:node_modules/react",
"//:node_modules/react-dom",
"//:node_modules/vite",
"//:node_modules/@vitejs/plugin-react",
] + glob([
"public/**",
"src/**/*.css",
"src/**/*.ts",
"src/**/*.tsx",
]),
out_dirs = ["dist"],
chdir = package_name(),
args = ["build"],
)
vite_bin.vite_binary(
name = "preview",
args = ["preview"],
data = [":build"],
)
playwright_bin.playwright(
name = "install_browsers",
out_dirs = ["browsers"],
chdir = package_name(),
args = ["install"],
env = { "PLAYWRIGHT_BROWSERS_PATH": "browsers" },
)
vitest_bin.vitest_test(
name = "test",
args = ["run"],
data = [
":install_browsers",
":vitest.setup.ts",
":vitest.config.ts",
"//:node_modules/@testing-library/dom",
"//:node_modules/@testing-library/jest-dom",
"//:node_modules/@testing-library/react",
"//:node_modules/react",
"//:node_modules/react-dom",
"//:node_modules/vitest",
"//:node_modules/@vitejs/plugin-react",
"//:node_modules/@vitest/browser-playwright",
] + glob([
"src/**/*.ts",
"src/**/*.tsx",
]),
env = { "PLAYWRIGHT_BROWSERS_PATH": "browsers" },
)