protoc -I=$SRC_DIR \
--java_out=$DST_DIR \
$SRC_DIR/HelloService.proto
protoc -I=$SRC_DIR \
--js_out=import_style=commonjs:$OUT_DIR \
--grpc-web_out=import_style=commonjs,mode=grpcwebtext:$OUT_DIR \
echo.proto
- import_style=closure: The default generated code has Closure goog.require() import style.
- import_style=commonjs: The CommonJS style require() is also supported.
- import_style=commonjs+dts: (Experimental) In addition to above, a .d.ts typings file will also be generated for the protobuf messages and service stub.
- import_style=typescript: (Experimental) The service stub will be generated in TypeScript.
- mode=grpcwebtext: The default generated code sends the payload in the grpc-web-text format. Content-type: application/grpc-web-text Payload are base64-encoded. Both unary and server streaming calls are supported.
- mode=grpcweb: A binary protobuf format is also supported. Content-type: application/grpc-web+proto Payload are in the binary protobuf format. Only unary calls are supported for now.
プラグインファイル名: protoc-gen-{name} 呼び出し方: --{name}_out=...
コマンド: protoc --foo_out=arg1=aaaaaa,arg2,arg3=cccccc:DIR input.proto 引数: ':'までが引数となる。この場合'arg1=aaaaaa,arg2,arg3=cccccc'がプラグインへの引数