{"action":"created","issue":{"url":"https://api.github.com/repos/andrewrk/browserify-lite/issues/4","labels_url":"https://api.github.com/repos/andrewrk/browserify-lite/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/andrewrk/browserify-lite/issues/4/comments","events_url":"https://api.github.com/repos/andrewrk/browserify-lite/issues/4/events","html_url":"https://github.com/andrewrk/browserify-lite/issues/4","id":92868389,"number":4,"title":"support for global","user":{"login":"dpocock","id":1236687,"avatar_url":"https://avatars.githubusercontent.com/u/1236687?v=3","gravatar_id":"","url":"https://api.github.com/users/dpocock","html_url":"https://github.com/dpocock","followers_url":"https://api.github.com/users/dpocock/followers","following_url":"https://api.github.com/users/dpocock/following{/other_user}","gists_url":"https://api.github.com/users/dpocock/gists{/gist_id}","starred_url":"https://api.github.com/users/dpocock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpocock/subscriptions","organizations_url":"https://api.github.com/users/dpocock/orgs","repos_url":"https://api.github.com/users/dpocock/repos","events_url":"https://api.github.com/users/dpocock/events{/privacy}","received_events_url":"https://api.github.com/users/dpocock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-03T12:44:46Z","updated_at":"2015-07-04T11:58:21Z","closed_at":null,"body":"If a module refers to ```global```, browserify wraps the module:\r\n\r\n      32:[function(require,module,exports){\r\n         (function (global){\r\n      ... module source ...\r\n      }).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\r\n\r\n\r\nso that references to ```global``` will work.\r\n\r\nAs a workaround, it is possible to patch browserify-lite output with sed to correct references to ```global``` and change them to ```window``` but could this be done in browserify-lite somehow?\r\n"},"comment":{"url":"https://api.github.com/repos/andrewrk/browserify-lite/issues/comments/118503787","html_url":"https://github.com/andrewrk/browserify-lite/issues/4#issuecomment-118503787","issue_url":"https://api.github.com/repos/andrewrk/browserify-lite/issues/4","id":118503787,"user":{"login":"dpocock","id":1236687,"avatar_url":"https://avatars.githubusercontent.com/u/1236687?v=3","gravatar_id":"","url":"https://api.github.com/users/dpocock","html_url":"https://github.com/dpocock","followers_url":"https://api.github.com/users/dpocock/followers","following_url":"https://api.github.com/users/dpocock/following{/other_user}","gists_url":"https://api.github.com/users/dpocock/gists{/gist_id}","starred_url":"https://api.github.com/users/dpocock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dpocock/subscriptions","organizations_url":"https://api.github.com/users/dpocock/orgs","repos_url":"https://api.github.com/users/dpocock/repos","events_url":"https://api.github.com/users/dpocock/events{/privacy}","received_events_url":"https://api.github.com/users/dpocock/received_events","type":"User","site_admin":false},"created_at":"2015-07-04T11:58:21Z","updated_at":"2015-07-04T11:58:21Z","body":"With browserify, ```global``` is not always ```window``` - it is also meant to be possible to use the browserified JavaScript in Node.  But for browserify-lite, I think that hardcoding it to window as you propose is fine."}}