diff --git a/server.js b/server.js index 658ef53..4a2f4e1 100644 --- a/server.js +++ b/server.js @@ -14,13 +14,19 @@ import {StaticRouter} from 'react-router'; var legacyPort = 8080; const socket = process.env.socket || '/run/node/node.sock'; -global.window = { - addEventListener: () => {}, - scrollTo: () => {} -}; -global.document = { - addEventListener: () => {} -}; +function refreshGlobal() { + global.window = { + addEventListener: () => {}, + scrollTo: () => {}, + innerWidth: 1200, + innerHeight: 800, + isServer: true + }; + global.document = { + addEventListener: () => {} + }; +} +refreshGlobal(); var AppComponent = require('./src/App').default; diff --git a/sslServer.js b/sslServer.js index 032b467..74d26b4 100644 --- a/sslServer.js +++ b/sslServer.js @@ -19,13 +19,19 @@ var sslPort = 8443; var port = 8081; var legacyPort = 8080; -global.window = { - addEventListener: () => {}, - scrollTo: () => {} -}; -global.document = { - addEventListener: () => {} -}; +function refreshGlobal() { + global.window = { + addEventListener: () => {}, + scrollTo: () => {}, + innerWidth: 1200, + innerHeight: 800, + isServer: true + }; + global.document = { + addEventListener: () => {} + }; +} +refreshGlobal(); var AppComponent = require('./src/App').default; diff --git a/testServer.js b/testServer.js index 5416e17..81a4dce 100644 --- a/testServer.js +++ b/testServer.js @@ -14,13 +14,19 @@ import {StaticRouter} from 'react-router'; var port = 8081; var legacyPort = 8080; -global.window = { - addEventListener: () => {}, - scrollTo: () => {} -}; -global.document = { - addEventListener: () => {} -}; +function refreshGlobal() { + global.window = { + addEventListener: () => {}, + scrollTo: () => {}, + innerWidth: 1200, + innerHeight: 800, + isServer: true + }; + global.document = { + addEventListener: () => {} + }; +} +refreshGlobal(); var AppComponent = require('./src/App').default;