build: Bazel rules_js — link node_modules via pnpm-lock
bazel build //walldash:node_modules. Adds pnpm-lock.yaml (from package-lock) + pnpm.onlyBuiltDependencies, and npm_link_all_packages in BUILD.bazel. Native bun build/run is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8c8c37fb7e
commit
f69b9f401a
3 changed files with 1083 additions and 15 deletions
23
BUILD.bazel
23
BUILD.bazel
|
|
@ -1,19 +1,12 @@
|
||||||
# Next.js app built with bun, which rules_js cannot consume. This app keeps its
|
load("@npm//:defs.bzl", "npm_link_all_packages")
|
||||||
# native `bun`/Next.js build. The filegroup just makes the directory a valid
|
|
||||||
# Bazel package and exposes sources.
|
# rules_js PoC: link the full npm dependency graph (from package-lock.json) via
|
||||||
# TODO: for real Bazel builds, generate a package-lock.json and adopt
|
# Bazel. `bazel build //walldash:node_modules` resolves all packages.
|
||||||
# aspect_rules_js (https://github.com/aspect-build/rules_js).
|
# A complete `next build` under Bazel is a further step (ts_project + next rule).
|
||||||
|
npm_link_all_packages(name = "node_modules")
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
name = "srcs",
|
name = "srcs",
|
||||||
srcs = glob(["src/**"], allow_empty = True) + glob(
|
srcs = glob(["src/**"], allow_empty = True),
|
||||||
[
|
|
||||||
"*.ts",
|
|
||||||
"*.tsx",
|
|
||||||
"*.mjs",
|
|
||||||
"*.js",
|
|
||||||
"*.json",
|
|
||||||
],
|
|
||||||
allow_empty = True,
|
|
||||||
),
|
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -28,5 +28,8 @@
|
||||||
"react": "^19.2.5",
|
"react": "^19.2.5",
|
||||||
"react-dom": "^19.2.5",
|
"react-dom": "^19.2.5",
|
||||||
"react-router-dom": "^7.14.1"
|
"react-router-dom": "^7.14.1"
|
||||||
|
},
|
||||||
|
"pnpm": {
|
||||||
|
"onlyBuiltDependencies": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1072
pnpm-lock.yaml
Normal file
1072
pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue