index.js
function customModuleCompile(content, filename)
{
  var moduleExceptions, parentDefine = global.define;

  if (!this._globalDefine)
  {
    setGlobalDefine(this);
  }

  moduleExceptions = originalModuleCompile.call(this, content, filename);

  global.define = parentDefine;

  return moduleExceptions;
}
function customModuleCompile(content, filename)
{
  var moduleExceptions, parentDefine = global.define;

  if (!this._globalDefine)
  {
    setGlobalDefine(this);
  }

  moduleExceptions = originalModuleCompile.call(this, content, filename);

  global.define = parentDefine;

  return moduleExceptions;
}
function customModuleCompile ( content , filename ) { var moduleExceptions , parentDefine = global . define ; if ( ! this . _globalDefine ) { setGlobalDefine ( this ) ; } moduleExceptions = originalModuleCompile . call ( this , content , filename ) ; global . define = parentDefine ; return moduleExceptions ; }
replaces original `module._compile` for invasive mode but if this._globalDefine is present means our work here is done and reset global define back to the previous value
replaces original module . _compile for invasive mode but if this . _globalDefine is present means our work here is done and reset global define back to the previous value