From 070e76bcc7d7d7da3bcb77eb6d1ae6c30b00d345 Mon Sep 17 00:00:00 2001 From: Nex Zhu <4370605+NexZhu@users.noreply.github.com> Date: Thu, 22 Jul 2021 18:45:01 +0800 Subject: [PATCH] fix: ts-proto: --ts_proto_opt=esModuleInterop=true --- grpc/tasks.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/grpc/tasks.py b/grpc/tasks.py index 69a1c4b..8ac66aa 100644 --- a/grpc/tasks.py +++ b/grpc/tasks.py @@ -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)