{"action":"created","issue":{"url":"https://api.github.com/repos/snikch/jquery.dirtyforms/issues/82","labels_url":"https://api.github.com/repos/snikch/jquery.dirtyforms/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/snikch/jquery.dirtyforms/issues/82/comments","events_url":"https://api.github.com/repos/snikch/jquery.dirtyforms/issues/82/events","html_url":"https://github.com/snikch/jquery.dirtyforms/issues/82","id":104651956,"number":82,"title":"Can not connect dirtyforms with requirejs","user":{"login":"ar4ers","id":6881329,"avatar_url":"https://avatars.githubusercontent.com/u/6881329?v=3","gravatar_id":"","url":"https://api.github.com/users/ar4ers","html_url":"https://github.com/ar4ers","followers_url":"https://api.github.com/users/ar4ers/followers","following_url":"https://api.github.com/users/ar4ers/following{/other_user}","gists_url":"https://api.github.com/users/ar4ers/gists{/gist_id}","starred_url":"https://api.github.com/users/ar4ers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ar4ers/subscriptions","organizations_url":"https://api.github.com/users/ar4ers/orgs","repos_url":"https://api.github.com/users/ar4ers/repos","events_url":"https://api.github.com/users/ar4ers/events{/privacy}","received_events_url":"https://api.github.com/users/ar4ers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-09-03T09:07:20Z","updated_at":"2015-09-06T08:08:46Z","closed_at":null,"body":"https://github.com/snikch/jquery.dirtyforms/blob/master/jquery.dirtyforms.js#L12\r\nAt this row function `factory` called without its `window` and `document` parameters, which leads to application crash."},"comment":{"url":"https://api.github.com/repos/snikch/jquery.dirtyforms/issues/comments/138051591","html_url":"https://github.com/snikch/jquery.dirtyforms/issues/82#issuecomment-138051591","issue_url":"https://api.github.com/repos/snikch/jquery.dirtyforms/issues/82","id":138051591,"user":{"login":"NightOwl888","id":1538288,"avatar_url":"https://avatars.githubusercontent.com/u/1538288?v=3","gravatar_id":"","url":"https://api.github.com/users/NightOwl888","html_url":"https://github.com/NightOwl888","followers_url":"https://api.github.com/users/NightOwl888/followers","following_url":"https://api.github.com/users/NightOwl888/following{/other_user}","gists_url":"https://api.github.com/users/NightOwl888/gists{/gist_id}","starred_url":"https://api.github.com/users/NightOwl888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NightOwl888/subscriptions","organizations_url":"https://api.github.com/users/NightOwl888/orgs","repos_url":"https://api.github.com/users/NightOwl888/repos","events_url":"https://api.github.com/users/NightOwl888/events{/privacy}","received_events_url":"https://api.github.com/users/NightOwl888/received_events","type":"User","site_admin":false},"created_at":"2015-09-06T08:08:46Z","updated_at":"2015-09-06T08:08:46Z","body":"Unfortunately, that would defeat the purpose. The whole idea is that you can inject the global variables from somewhere else so you can mock them if needed.\r\n\r\nI found an example of how this is used in [jQuery](https://github.com/jquery/jquery/blob/master/src/var/document.js). You just need to create a file to wrap each global variable.\r\n\r\ndocument.js\r\n==\r\n\r\n```js\r\ndefine(function() { \r\n\treturn window.document; \r\n}); \r\n```\r\n\r\nwindow.js\r\n==\r\n\r\n```js\r\ndefine(function() { \r\n\treturn window; \r\n}); \r\n```\r\n\r\nI should probably put these into a subdirectory and ship them inside of the packages so everything will work in production and on the CDN. But please try adding these files first to see if that works."}}