Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Latest commit

 

History

History
 
 

node

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

NodeJs Rules

Rule Description
node_proto_repositories Load workspace dependencies.
node_proto_compile Generate node js protobuf source files.

NOTE: These rules are currenty not compatible with the bazel sandbox. To use them you'll have to use --spawn_strategy=standalone.

node_proto_repositories

Enable node support by loading the dependencies in your workspace.

IMPORTANT: This should occur after loading rules_node.

load("@org_pubref_rules_protobuf//node:rules.bzl", "node_proto_repositories")
node_proto_repositories()

node_proto_compile

This is a thin wrapper over the proto_compile rule having language @org_pubref_rules_protobuf//node (common js output of the --js_out protoc option.

load("@org_pubref_rules_protobuf//node:rules.bzl", "node_proto_compile")

node_proto_compile(
  name = "protos",
  protos = ["message.proto"],
  with_grpc = True,
)
$ bazel build :protos
Target //:protos up-to-date:
  bazel-genfiles/message_pb.js
  bazel-genfiles/message_grpc_pb.js