How to process proto files with "import" statement using probufjs cli?

33 Views Asked by At

I got several proto files: A.proto, B.proto, C.proto

A.proto file import B.proto and C.proto:

import B.proto
import C.proto
... ... ...
message A{
...
}

B.proto file import C.proto:

import C.proto
... ... ...
message B{
...
}

C.proto dosen't import any other files.

Now, I wanna generate JS and TS files using pbjs command. Generate A.js by using:

pbjs -t static-module -w es6 -o A.js A.proto B.proto C.proto

Generate B.js by using:

pbjs -t static-module -w es6 -o B.js  B.proto C.proto

There is a problem that both A.js and B.js files contain duplicate content, both of which contain the content of the C.js file.

How to solve this problem so that there is no redundant content in the generated A.proto and B.proto files.

0

There are 0 best solutions below