Skip to content
This repository has been archived by the owner on Jun 5, 2021. It is now read-only.

Bazel-managed nodejs dependencies #26

Open
gulrotkake opened this issue Sep 25, 2018 · 2 comments
Open

Bazel-managed nodejs dependencies #26

gulrotkake opened this issue Sep 25, 2018 · 2 comments

Comments

@gulrotkake
Copy link

gulrotkake commented Sep 25, 2018

Any plans to support the dependency management repository rules provided by bazelbuild/rules_nodejs?

Ie, something like:

ts_library(
  name = "src",
  srcs = glob([
    "*.tsx",
  ]),
  tsconfig = "//web:tsconfig.json",
  deps = [
     "@npm//:typescript",
     "@npm//:react",
  ],
  tags = ["block-network"],
)

instead of using the npm_packages rule?

@fwouts
Copy link
Owner

fwouts commented Sep 26, 2018

Hi Michael, not exactly. However you may be interested in the discussion happening in #19.

In the above example, how would you specify which exact version of typescript, react and all of their dependencies to use, to make sure builds are completely reproducible?

@gulrotkake
Copy link
Author

Hi François,

thanks for the reply, #19 was indeed an interesting discussion and puts the complexity of the issue a bit more into perspective :).

As for my example above, the versions of typescript and react are specified in a yarn.lock file, which is included in the workspace as such:

load("@build_bazel_rules_nodejs//:defs.bzl", "yarn_install")

yarn_install(
    name = "npm",
    package_json = "//:package.json",
    yarn_lock = "//:yarn.lock",
)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants