| workspace( |
| name = "from_source", |
| managed_directories = {"@npm": ["node_modules"]}, |
| ) |
| |
| # In your code, you'd fetch this repository with a `git_repository` call. |
| # We do this local repository only because this example lives in the same |
| # repository with the rules_nodejs code and we want to test them together. |
| local_repository( |
| name = "build_bazel_rules_nodejs", |
| path = "../../", |
| ) |
| |
| # This is hard for users to grab hold of, as long as rules_typescript is a |
| # nested workspace within rules_nodejs. Until we've fixed that, you can |
| # replace this local_repository call with this code to fetch it |
| # https://github.com/bazelbuild/rules_nodejs/blob/2.2.2/package.bzl#L123-L134 |
| local_repository( |
| name = "build_bazel_rules_typescript", |
| path = "../../third_party/github.com/bazelbuild/rules_typescript", |
| ) |
| |
| load("@build_bazel_rules_nodejs//:package.bzl", "rules_nodejs_dev_dependencies") |
| |
| rules_nodejs_dev_dependencies() |
| |
| load("@build_bazel_rules_typescript//:package.bzl", "rules_typescript_dev_dependencies") |
| |
| rules_typescript_dev_dependencies() |
| |
| load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") |
| |
| go_rules_dependencies() |
| |
| go_register_toolchains(version = "1.16") |
| |
| load("@io_bazel_stardoc//:setup.bzl", "stardoc_repositories") |
| |
| stardoc_repositories() |
| |
| load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install") |
| |
| node_repositories( |
| node_version = "12.13.0", |
| package_json = ["//:package.json"], |
| yarn_version = "1.19.1", |
| ) |
| |
| yarn_install( |
| name = "npm", |
| exports_directories_only = True, |
| package_json = "//:package.json", |
| strict_visibility = True, |
| yarn_lock = "//:yarn.lock", |
| ) |