This would make it so that once the PDK invoked the function it would still try calling the
myFunction() on the global context, which would end up calling another function except
for the one exported.
This PR fixes that by finding the export name inside module.exports instead of
the global.
Sometimes when using bundlers to bundle the code for the plugin, bundlers would rename the function before exporting it, so if you had something like:
It could turn into something like:
This would make it so that once the PDK invoked the function it would still try calling the
myFunction()
on the global context, which would end up calling another function except for the one exported.This PR fixes that by finding the export name inside
module.exports
instead of theglobal
.