From 23c3ae7200d4fad4409d122920a9ac5eed450d04 Mon Sep 17 00:00:00 2001 From: elliottcable Date: Mon, 20 May 2013 20:16:34 -0400 Subject: [PATCH] Support `GLOBAL` in addition to `global` --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1bde70c..d9b9d76 100644 --- a/index.js +++ b/index.js @@ -35,6 +35,7 @@ module.exports = function (files, opts) { if (!opts.always && !/\bprocess\b/.test(row.source) && !/\bglobal\b/.test(row.source) + && !/\bGLOBAL\b/.test(row.source) && !/\bBuffer\b/.test(row.source) && !/\b__filename\b/.test(row.source) && !/\b__dirname\b/.test(row.source) @@ -72,8 +73,10 @@ module.exports = function (files, opts) { row.deps.__browserify_buffer = bufferModulePath; globals.Buffer = 'require("__browserify_buffer").Buffer'; } - if (scope.globals.implicit.indexOf('global') >= 0) { + if (scope.globals.implicit.indexOf('global') >= 0 + || scope.globals.implicit.indexOf('GLOBAL') >= 0) { globals.global = 'window'; + globals.GLOBAL = 'window'; } if (scope.globals.implicit.indexOf('__filename') >= 0) { var file = '/' + path.relative(basedir, row.id);