diff --git a/src/raven.js b/src/raven.js index d60e35b69acb..976f478f1369 100644 --- a/src/raven.js +++ b/src/raven.js @@ -4,7 +4,7 @@ // If there is no JSON, we no-op the core features of Raven // since JSON is required to encode the payload var _Raven = window.Raven, - hasJSON = !!(window.JSON && window.JSON.stringify), + hasJSON = !!(JSON && JSON.stringify), lastCapturedException, lastEventId, globalServer, diff --git a/template/_footer.js b/template/_footer.js index e15c9ebff72b..e566142206b8 100644 --- a/template/_footer.js +++ b/template/_footer.js @@ -1,9 +1,13 @@ // Expose Raven to the world -window.Raven = Raven; // AMD if (typeof define === 'function' && define.amd) { define('raven', [], function() { return Raven; }); } - +else if (typeof module == 'object') { + module.exports = Raven; +} +else { + window.Raven = Raven; +} })(this);