Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make Lo-Dash work with Browserify. [closes #223]

  • Loading branch information...
commit c13fff5bca7bec28802080e91783d66c54894ba2 1 parent 37ec299
@jdalton jdalton authored
Showing with 4 additions and 3 deletions.
  1. +1 −1  build.js
  2. +1 −0  build/pre-compile.js
  3. +2 −2 lodash.js
View
2  build.js
@@ -510,7 +510,7 @@
" var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;",
'',
" var freeGlobal = typeof global == 'object' && global;",
- ' if (freeGlobal.global === freeGlobal) {',
+ ' if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {',
' window = freeGlobal;',
' }',
'',
View
1  build/pre-compile.js
@@ -214,6 +214,7 @@
'values',
'variable',
'where',
+ 'window',
'without',
'wrap',
'zip',
View
4 lodash.js
@@ -17,9 +17,9 @@
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
- /** Detect free variable `global` and use it as `window` */
+ /** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global;
- if (freeGlobal.global === freeGlobal) {
+ if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal;
}
Please sign in to comment.
Something went wrong with that request. Please try again.