improbable-eng / ts-protoc-gen

Protocol Buffers Compiler (protoc) plugin for TypeScript and gRPC-Web.
Apache License 2.0
1.36k stars 173 forks source link

How to generate typescript files for services instead of js ones? Is there a way to avoid `require` using import `instead`? #274

Open frederikhors opened 3 years ago

frederikhors commented 3 years ago

I'm new to this proto* world!

Is there a way to automagically generate .ts (typescript) files for services instead of .js (javascript) files?

I'm stucked using it with vitejs.dev or any webpack bundler because of the requires.

thesayyn commented 3 years ago

An alternative version is available which is maintained by me and a few other people that generate a typescript source file directly instead of combining javascript with d.ts. You can take look and see how it compares to this plugin.

https://github.com/thesayyn/protoc-gen-ts

randuck-dev commented 3 years ago

I am also interested in the future of this plugin and whether it will be able to generate code that is ES6 compliant. Same use case as OP where I am attempting to use the generated code with vitejs.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.