-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBUILD.bazel
71 lines (63 loc) · 1.55 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
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//:vite/package_json.bzl", vite_bin = "bin")
load("@npm//:vitest/package_json.bzl", vitest_bin = "bin")
# This macro expands to a link_npm_package for each third-party package in package.json
# See https://docs.aspect.build/rules/aspect_rules_js/docs/pnpm
npm_link_all_packages(name = "node_modules")
package(default_visibility = ["//visibility:public"])
filegroup(
name = "config",
srcs = [
"index.html",
"package.json",
"tsconfig.json",
"tsconfig.node.json",
"vite.config.ts",
],
)
filegroup(
name = "vite_srcs_export",
srcs = glob(["src/**/*"]),
visibility = ["//visibility:public"],
)
filegroup(
name = "vite_public_export",
srcs = glob(["public/**/*"]),
visibility = ["//visibility:public"],
)
filegroup(
name = "vite_srcs_tests",
srcs = glob([
"src/**/*.spec.ts",
"tests/**/*",
]),
visibility = ["//visibility:public"],
)
vite_bin.vite(
name = "build",
srcs = [
":config",
":node_modules",
":vite_public_export",
":vite_srcs_export",
],
args = ["build"],
chdir = package_name(),
out_dirs = ["dist"],
visibility = ["//visibility:public"],
)
vitest_bin.vitest_test(
name = "ut_test",
args = [
"run",
],
chdir = package_name(),
data = [
":config",
":node_modules",
":vite_public_export",
":vite_srcs_export",
":vite_srcs_tests",
],
visibility = ["//visibility:public"],
)