-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMODULE.bazel
58 lines (44 loc) · 1.85 KB
/
MODULE.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
"bazel_web_template"
# https://registry.bazel.build/
# Must-have for building macros & rules
bazel_dep(name = "aspect_bazel_lib", version = "2.11.0")
# Common utils
bazel_dep(name = "bazel_skylib", version = "1.7.1")
# Base for JS
bazel_dep(name = "rules_nodejs", version = "6.3.2")
# Must-have for JS
bazel_dep(name = "aspect_rules_js", version = "2.1.2")
# Must-have for TS
bazel_dep(name = "aspect_rules_ts", version = "3.4.0")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
# NodeJS version dependant on rules_nodejs
# https://github.com/bazelbuild/rules_nodejs/releases/latest -> nodejs/private/node_versions.bzl
# check always latest version *released*
node.toolchain(
# Also defined at package.json
node_version_from_nvmrc = "//:.nvmrc",
)
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
# pnpm version dependant on rules_js
# https://github.com/aspect-build/rules_js/releases/latest -> npm/private/versions.bzl
# check always latest version *released*
# Note: pnpm lockfile v9 not yet supported
npm.npm_translate_lock(
name = "npm",
pnpm_lock = "//:pnpm-lock.yaml",
npmrc = "//:.npmrc",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
use_repo(pnpm, "pnpm")
rules_ts_ext = use_extension("@aspect_rules_ts//ts:extensions.bzl", "ext", dev_dependency = True)
# TypeScript version dependant on rules_ts
# https://github.com/aspect-build/rules_ts/releases/latest -> ts/private/versions.bzl
# check always latest version *released*
rules_ts_ext.deps(
ts_version_from = "//:package.json",
)
use_repo(rules_ts_ext, "npm_typescript")