| 1 |
"""Module extension to fetch Node.js native addon build dependencies. |
| 2 |
|
| 3 |
node-addon-api itself comes from the Bazel Central Registry (see the |
| 4 |
`bazel_dep(name = "node_addon_api", ...)` in MODULE.bazel) and the Node C |
| 5 |
headers come from the rules_nodejs Node toolchain. This extension only fetches |
| 6 |
the one piece available from neither: |
| 7 |
- Node.js 20.20.2 win-x64 node.lib → @node_win_x64_lib |
| 8 |
""" |
| 9 |
|
| 10 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") |
| 11 |
|
| 12 |
def _node_deps_impl(ctx): |
| 13 |
# Node.js import library for Windows addon builds. |
| 14 |
http_file( |
| 15 |
name = "node_win_x64_lib", |
| 16 |
url = "https://nodejs.org/dist/v20.20.2/win-x64/node.lib", |
| 17 |
sha256 = "c4a794e993d9304238523230885e9ec00ca052c73b9558471858eef14916d91f", |
| 18 |
) |
| 19 |
|
| 20 |
node_deps = module_extension( |
| 21 |
implementation = _node_deps_impl, |
| 22 |
) |