Skip to content

Commit

Permalink
Update ReactDOM's UMD header
Browse files Browse the repository at this point in the history
Fixes #365
  • Loading branch information
ipeychev committed Nov 5, 2015
1 parent bd54f39 commit cab278c
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions src/ui/react/vendor/react-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,18 @@
*/
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
;(function(f) {
// CommonJS
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = f(require('react'));

// RequireJS
} else if (typeof define === "function" && define.amd) {
define(['react'], f);

// <script>
if (typeof module !== "undefined" && typeof module.exports === "object") {
module.exports.ReactDOM = f(module.exports.React);
} else if (typeof AlloyEditor === "object") {
AlloyEditor.ReactDOM = f(AlloyEditor.React);
} else if (typeof window !== "undefined") {
window.ReactDOM = f(window.React);
} else if (typeof self !== "undefined") {
self.ReactDOM = f(self.React);
} else if (typeof global !== "undefined") {
global.ReactDOM = f(global.React);
} else {
var g
if (typeof window !== "undefined") {
g = window;
} else if (typeof global !== "undefined") {
g = global;
} else if (typeof self !== "undefined") {
g = self;
} else {
// works providing we're not in "use strict";
// needed for Java 8 Nashorn
// see https://github.com/facebook/react/issues/3037
g = this;
}
g.ReactDOM = f(g.React);
this.ReactDOM = f(this.React);
}

})(function(React) {
Expand Down

0 comments on commit cab278c

Please sign in to comment.