Empty object as a value of bind module option will not produce any require() calls, but still is useful for modules exporting its stuff via setting of modules's this object properties.
For example, lazy.js does this. In the linked code, context is a parameter of IIFE creating whole code scope, so context is the this passed to IIFE, i.e. object that could be set by LMD's bind option.
As a sidenote: lazy.js tries also to use exports, but makes one wrong assumption, so it doesn't work with LMD.
Empty object as a value of
bind
module option will not produce anyrequire()
calls, but still is useful for modules exporting its stuff via setting of modules'sthis
object properties.For example, lazy.js does this. In the linked code,
context
is a parameter of IIFE creating whole code scope, socontext
is thethis
passed to IIFE, i.e. object that could be set by LMD'sbind
option.As a sidenote: lazy.js tries also to use
exports
, but makes one wrong assumption, so it doesn't work with LMD.