Merge pull request #1236 from jsguy/next
Set dependencies when no window for isomorphic compatibility
This commit is contained in:
commit
b0c246e2b4
1 changed files with 9 additions and 0 deletions
|
|
@ -4,6 +4,15 @@
|
||||||
"use strict"
|
"use strict"
|
||||||
/* eslint-disable no-undef */
|
/* eslint-disable no-undef */
|
||||||
var m = factory(global)
|
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) {
|
if (typeof module === "object" && module != null && module.exports) {
|
||||||
module.exports = m
|
module.exports = m
|
||||||
} else if (typeof define === "function" && define.amd) {
|
} else if (typeof define === "function" && define.amd) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue