Set dependencies when no window for isomorphic compatibility

This commit is contained in:
jsguy 2016-08-13 11:07:21 +10:00
parent 6fe960ee8a
commit c6d57c7f53

View file

@ -4,6 +4,15 @@
"use strict"
/* eslint-disable no-undef */
var m = factory(global)
/* Set dependencies when no window for isomorphic compatibility */
if(typeof window === "undefined") {
m.deps({
document: typeof document !== "undefined"? document: {},
location: typeof location !== "undefined"? location: {},
clearTimeout: clearTimeout,
setTimeout: setTimeout
});
}
if (typeof module === "object" && module != null && module.exports) {
module.exports = m
} else if (typeof define === "function" && define.amd) {