esperantojs / esperanto

DEPRECATED: An easier way to convert ES6 modules to AMD and CommonJS
http://esperantojs.org
234 stars 21 forks source link

How do I get lodash to reference global._ in UMD? #154

Open lukescott opened 9 years ago

lukescott commented 9 years ago

When using the bundler I get this:

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('lodash')) :
  typeof define === 'function' && define.amd ? define(['lodash'], factory) :
  global.app = factory(global.lodash)
}(this, function (lodash) { 'use strict';

But on the "try it now" (single file) I get this:

(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('lodash')) :
    typeof define === 'function' && define.amd ? define(['lodash'], factory) :
    factory(global._)
}(this, function (_) { 'use strict';

global.lodash doesn't exist. Is there any way to tell it to use global._ instead?