protobuf.js version: 6.9.0
Hi! I want to use CLI to generate static code from my .proto file. I used the next command:
$ yarn pbjs -t static-module -w es6 -o packages/protobuf-encoder/generated/message_pb.js message.proto
But it seems that generated file contains invalid import statement on top:
// message_pb.js file
import * as $protobuf from "protobufjs/minimal";
...
If we look at minimal.js file, we'll find there CommonJS-style export module.exports = require("./src/index-minimal");. AFAIK in ES6 we can import such modules, using only default export. So the valid import should be import $protobuf from "protobufjs/minimal". I edited the generated file manually and it works now.
Am I missing something here?
protobuf.js version: 6.9.0
Hi! I want to use CLI to generate static code from my
.protofile. I used the next command:But it seems that generated file contains invalid import statement on top:
If we look at
minimal.jsfile, we'll find there CommonJS-style exportmodule.exports = require("./src/index-minimal");. AFAIK in ES6 we can import such modules, using onlydefaultexport. So the valid import should beimport $protobuf from "protobufjs/minimal". I edited the generated file manually and it works now.Am I missing something here?