protobuf-javascript icon indicating copy to clipboard operation
protobuf-javascript copied to clipboard

How to skip useless import path

Open chenjie199234 opened this issue 3 years ago • 2 comments

I have a import which is not used for javascript When use this plugin to generate the code, the useless import become a require(xxx) How to disable this. 1

2

chenjie199234 avatar Nov 29 '22 11:11 chenjie199234

This seems like a reasonable FR. We don't generate code for services and proto options, so this is a surprise to see.

Relevant bit of code: https://github.com/protocolbuffers/protobuf-javascript/blob/main/generator/js_generator.cc#L3651-L3657

dibenede avatar Nov 29 '22 18:11 dibenede

@dibenede I want to generate both the server's code and the browser's javascript code Some import is only for server like field value validate extend Need a way to skip this, there are too may other extends can be find on github

chenjie199234 avatar Nov 30 '22 05:11 chenjie199234