-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Added support for CommonJS/browserify. #261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e29930b
28e7551
87c8b4e
44be740
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
// Expose Raven to the world | ||
window.Raven = Raven; | ||
|
||
// AMD | ||
if (typeof define === 'function' && define.amd) { | ||
define('raven', [], function() { return Raven; }); | ||
// AMD | ||
define('raven', function(Raven) { | ||
return (window.Raven = Raven); | ||
}); | ||
} else if (isObject(module)) { | ||
// browserify | ||
module.exports = Raven; | ||
} else if (isObject(exports)) { | ||
// CommonJS | ||
exports = Raven; | ||
} else { | ||
// Everything else | ||
window.Raven = Raven; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, we can't do this. It also needs to exist on the global scope for AMD to make plugins work. So until someone else redesigns those, we can't do this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wtf is that garbage There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ugh, I'll accept that if it stops this back and forth argument. So gross though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think anyone using browserify will be fine with https://github.com/umdjs/umd/blob/master/returnExportsGlobal.js which seems a little cleaner and more straightforward. What would you like to support: CommonJS or browserify? From the issues, it seems as though most people are interested in browserify. |
||
} | ||
|
||
})(window); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this because the package.json is now
raven-js
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah 😐
I noticed it and since it was from something I suggested, I figured I'd clob it in here. I have it on a separate commit and referenced the issue from the commit message.