-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
MODULE.bazel
62 lines (55 loc) · 2.02 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
59
60
61
62
bazel_dep(name = "aspect_rules_js", version = "0.0.0", dev_dependency = True)
local_path_override(
module_name = "aspect_rules_js",
path = "../..",
)
bazel_dep(name = "other_module")
local_path_override(
module_name = "other_module",
path = "other_module",
)
bazel_dep(name = "aspect_bazel_lib", version = "2.9.0", dev_dependency = True)
bazel_dep(name = "bazel_skylib", version = "1.5.0", dev_dependency = True)
bazel_dep(name = "platforms", version = "0.0.10", dev_dependency = True)
npm = use_extension(
"@aspect_rules_js//npm:extensions.bzl",
"npm",
dev_dependency = True,
)
npm.npm_translate_lock(
name = "npm",
# Test that lifecycle hooks can resolve node, npm as well as dep bins on that PATH.
# This e2e test is run on Windows as well so this test coverage is here for now. Once
# Windows CI runs on the root WORKSPACE, coverage can be moved there.
# See https://github.com/aspect-build/rules_js/pull/1142 for more info.
custom_postinstalls = {
"chalk": "node --version",
"less": "npm --version",
"jasmine": "tsc --version",
},
npmrc = "//:.npmrc",
pnpm_lock = "//:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
# The following is just a demonstration that you can skip the npm_translate_lock feature
# and import npm packages directly, with no lock file.
# This is not typical use.
# See docs in /docs/npm_import.md about the difference.
npm.npm_import(
name = "npm_meaning-of-life",
package = "meaning-of-life",
version = "1.0.0",
)
use_repo(npm, "npm_meaning-of-life")
use_repo(npm, "npm_meaning-of-life__links")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")
# Choose a different version of pnpm - note that only the "root" module may do this,
# not some transitive dependency.
pnpm.pnpm(
name = "pnpm",
pnpm_version = "8.15.2",
)
# Allows developers to run the identical version of pnpm for local workflows like
# bazel run -- @pnpm --dir $PWD install
use_repo(pnpm, "pnpm")