-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
96 lines (89 loc) · 2.06 KB
/
BUILD.bazel
File metadata and controls
96 lines (89 loc) · 2.06 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
88
89
90
91
92
93
94
95
96
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@npm//:eslint/package_json.bzl", eslint_bin = "bin")
load("@npm//:next/package_json.bzl", next_bin = "bin")
load("@aspect_rules_js//js:defs.bzl", "js_run_binary")
npm_link_all_packages(name = "node_modules")
filegroup(
name = "app_srcs",
srcs = glob(
[
"app/**",
"components/**",
"data/**",
"hooks/**",
"lib/**",
"public/**",
"visualizers/**",
"*.json",
"*.mjs",
"*.ts",
],
exclude = [
".next/**",
"node_modules/**",
"out/**",
"package-lock.json",
"pnpm-lock.yaml",
],
allow_empty = True,
),
visibility = ["//visibility:private"],
)
next_bin.next_binary(
name = "next_js_binary",
visibility = ["//visibility:private"],
)
next_bin.next_binary(
name = "build",
args = ["build", "--webpack"],
chdir = package_name(),
data = [
":app_srcs",
":node_modules",
"next.config.mjs",
"package.json",
"postcss.config.mjs",
"tsconfig.json",
],
)
js_run_binary(
name = "site_export",
tool = ":next_js_binary",
args = ["build", "--webpack"],
chdir = package_name(),
srcs = [
":app_srcs",
":node_modules",
"next.config.mjs",
"package.json",
"postcss.config.mjs",
"tsconfig.json",
],
out_dirs = ["out"],
mnemonic = "NextJsExport",
progress_message = "Export static Next.js site %{label}",
)
next_bin.next_binary(
name = "dev",
args = ["dev"],
chdir = package_name(),
data = [
":app_srcs",
":node_modules",
"next.config.mjs",
"package.json",
"postcss.config.mjs",
"tsconfig.json",
],
)
eslint_bin.eslint_binary(
name = "lint",
args = ["."],
chdir = package_name(),
data = [
":app_srcs",
":node_modules",
"eslint.config.mjs",
"package.json",
],
)