feature/tauri-js-rs
bazel 52 lines 1.25 KB
Raw
1 "Root BUILD file for all frontend examples"
2
3 load("@npm//:defs.bzl", "npm_link_all_packages")
4 load("@aspect_rules_ts//ts:defs.bzl", "ts_config")
5 load("@npm//:next/package_json.bzl", next_bin = "bin")
6 load("@npm//:@tauri-apps/cli/package_json.bzl", tauri_bin = "bin")
7 load("defs.bzl", "next")
8
9 # Create the root of the "virtual store" of npm dependencies under bazel-out.
10 # This must be done in the package where the pnpm workspace is rooted.
11 npm_link_all_packages(name = "node_modules")
12
13 next_bin.next_binary(
14 name = "next_js_binary",
15 visibility = ["//visibility:public"],
16 )
17
18 ts_config(
19 name = "tsconfig",
20 src = "tsconfig.json",
21 visibility = ["//visibility:public"],
22 )
23
24 next(
25 name = "next",
26 srcs = [
27 "//app",
28 "//public",
29 ],
30 data = [
31 "next.config.js",
32 "postcss.config.js",
33 "tailwind.config.ts",
34 "package.json",
35 "jsconfig.json",
36 ":node_modules",
37 ],
38 next_bin = "./node_modules/next/dist/bin/next",
39 next_js_binary = ":next_js_binary",
40 )
41
42 tauri_bin.tauri_binary(
43 name = "tauri",
44 visibility = ["//visibility:public"],
45 args = ["dev"],
46 chdir = package_name(),
47 data = [
48 "//:node_modules",
49 "//:next",
50 "//src-tauri:tauri",
51 ],
52 )