You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@bufbuild/protoplugin added support for CommonJS in v1.6.0.
It would be nice if protoc-gen-connect-query supported the this feature as well. It needs to generate export statements with the new method GeneratedFile.exportDecl to do so.
Fixes#297
Add support for CommonJS with the new plugin option:
### `js_import_style`
By default,
[protoc-gen-connect-query](https://www.npmjs.com/package/@connectrpc/protoc-gen-connect-query)(and
all other plugins based on
[@bufbuild/protoplugin](https://www.npmjs.com/package/@bufbuild/protoplugin))
generate ECMAScript `import` and `export` statements. For use cases
where CommonJS is difficult to avoid, this option can be used to
generate CommonJS`require()` calls.
#### Example buf.gen.yaml
```
version: v1
plugins:
- plugin: es
out: src/gen
opt: js_import_style=legacy_commonjs
- plugin: connect-query
out: src/gen
opt: js_import_style=legacy_commonjs
```
@bufbuild/protoplugin added support for CommonJS in v1.6.0.
It would be nice if protoc-gen-connect-query supported the this feature as well. It needs to generate export statements with the new method
GeneratedFile.exportDecl
to do so.See connectrpc/connect-es#956 for the same update to protoc-gen-connect-es.
The text was updated successfully, but these errors were encountered: