Closed chris-kruining closed 2 years ago
Hi! Thanks for the question!
You're right that the _pb.js file doesn't directly contain module.exports
statements.. Although, they contain goog.exportSymbol(...)
statements which i believe will export the message classes into module space too.
See our common-js code examples on how import statements looks like, and the related Dockerfile on how the code is generated and bundled (using webpack).
Lemme know if you still have issues after seeing the examples! Thanks! :)
I fixed the issue with custom plugin that just generates typescript for me. so this is no longer relevant for me. Still, thank you for answering 😊
Of course! Glad it works for you now! Thank you for letting us know! :)
the _pb.js files generated with the commonjs import style do not define
module.exports
. how can I import my message classes in my code so I can construct a request message for example?currently I have this "build path":
CI of repo Library.Proto generates the stubs for web and c# and commits these to the respective repo CI of repo Library.Proto.Typescript builds the received typesctript files and bundles it all into a lib. npm install that-lib import the message class into business logic