Closed mmacfadden closed 4 years ago
This might be of interest. The folks over at Rollup have a workaround. Wonder if this could be incorporated into the codebase here?
https://github.com/rollup/rollup/issues/2747#issuecomment-507676912
@mmacfadden we're getting ready to move this plugin to https://github.com/rollup/plugins. If you'd like to open a discussion there for including a workaround into the plugin once the move is done, I'm sure it would be welcomed. We're going to close this for now, but thank you for opening this issue.
How Do We Reproduce?
I have created a repo which demonstrates the issue here: https://github.com/mmacfadden/rollup-protobufjs
There are instructions in the readme of the Repo.
Expected Behavior
The generated UMD module is usable.
Actual Behavior
An exception is thrown to the console when merely loading the bundle, before even using it. The issue seems to be that an object is being referenced in the resulting bundle before the object itself is being created. I suspect this has to do with resolution of circular dependencies.
I noted that protobufjs seems to have a browserify'ed version of the library already bundles, and I have used this browser version before, through hotlinking, however I would like to actually bundle protobufjs up in my library now, and it this issue.
Crossposted here: https://github.com/rollup/rollup/issues/2747