fix: ts-proto: --ts_proto_opt=esModuleInterop=true

This commit is contained in:
Nex Zhu 2021-07-22 18:45:01 +08:00
parent dc6ca140e7
commit 070e76bcc7
No known key found for this signature in database
GPG Key ID: 15C6254AD19362B4

View File

@ -37,7 +37,10 @@ def gen(c, target="types"):
if target == "ts":
plugin_path = npmbin_path / ("protoc-gen-ts_proto" + (".cmd" if platform.system() == "Windows" else ""))
cmd = "protoc --plugin=protoc-gen-ts_proto={} --ts_proto_opt=outputServices=grpc-js --ts_proto_out={} -I pb {}".format(
cmd = "protoc --plugin=protoc-gen-ts_proto={} " \
"--ts_proto_opt=outputServices=grpc-js " \
"--ts_proto_opt=esModuleInterop=true " \
"--ts_proto_out={} -I pb {}".format(
plugin_path, out_dir, "./pb/bdware/bdledger/api/*.proto")
print(cmd)
c.run(cmd)