You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 4, 2021. It is now read-only.
I'm trying to rollup protobufjs with rollup-plugin-commonjs, but I get undefined as export. It turns out the UMD wrapper of protobufjs will check the type of require to export the module as commonjs.
(function(global,factory){/* AMD */if(typeofdefine==='function'&&define["amd"])define(["bytebuffer"],factory);/* CommonJS */elseif(typeofrequire==="function"&&typeofmodule==="object"&&module&&module["exports"])module["exports"]=factory(require("bytebuffer"),true);/* Global */else(global["dcodeIO"]=global["dcodeIO"]||{})["ProtoBuf"]=factory(global["dcodeIO"]["ByteBuffer"]);})(this,function(ByteBuffer,isCommonJS){// factory})
The specs of Commonjs defines require as a Function. It make sense for wrapper to check for it. Currently, I use a plugin to add require as a noop function since it should never been called anyway. I hope rollup-plugin-commonjs can handle such use case more elegantly.