protobufjs / protobuf.js

Protocol Buffers for JavaScript & TypeScript.
Other
9.96k stars 1.42k forks source link

cli: support for generate non bundled files #1826

Open Psy-Kai opened 2 years ago

Psy-Kai commented 2 years ago

Hello,

is it possible to support generating js/ts files per proto-file? This would reflect the workflow of the protoc more. It also makes it much simpler to integrate with other tools. Normally a developer would already use a bundler so generating not bundled files would not be a problem. And if that feature is a option (like --sparse) non of the current functionality gets lost.

abhchand commented 1 week ago

Is there any progress on this feature? This library is overall much better than google's own JS Protobuf implementation, but the one thing Google's implementation does better is that it produces a separate .ts/.js output file for each .proto file.

Not only is this easier to read, it allows devs to selectively import just the functionality they need for a given pack (e.g if you are using webpack) instead of wastefully importing all bundled .proto files that this library generates.

Thanks!