【问题标题】:grpc-web compile proto file with wildcardgrpc-web 使用通配符编译 proto 文件
【发布时间】:2020-03-19 21:41:10
【问题描述】:

我有一个文件夹 protobuf,里面有很多可以编译的 .proto 文件

protoc -I=protobuf filename.proto --grpc-web_out=import_style=commonjs,mode=grpcwebtext:output

这会将grpc_web_pb.js 生成到/output 文件夹中,但我正在寻找一种不必为每个文件调用protoc 的方法,是否有类似通配符的东西?

我试过了

protoc -I=protobuf *.proto --grpc-web_out=import_style=commonjs,mode=grpcwebtext:output

但这不起作用,no matches found: *.proto 失败

【问题讨论】:

  • 支持通配符。我认为您的路径不正确(换句话说,编译器在它正在查找的目录中找不到 proto 文件)。

标签: protocol-buffers grpc-web


【解决方案1】:

这对我有用,也许只是将路径添加到您的 .proto 文件:

protoc -I . --grpc-web_out=import_style=commonjs,mode=grpcwebtext:. ./*.proto

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-07
    • 2020-04-09
    • 1970-01-01
    • 1970-01-01
    • 2020-01-03
    • 2021-03-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多