Skip to content

Commit

Permalink
fix(client): move SockJSClient definition
Browse files Browse the repository at this point in the history
  • Loading branch information
knagaitsev committed Jun 11, 2019
1 parent 24d207c commit eb69e4c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions client-src/default/socket.js
Expand Up @@ -5,17 +5,18 @@
camelcase
*/

// this SockJSClient is here as a default fallback, in case inline mode
// is off or the client is not injected. This will be switched to
// WebsocketClient when it becomes the default
const SockJSClient = require('../clients/SockJSClient');

let Client;
try {
// if __webpack_dev_server_client__ is undefined, we should fall back
// to SockJSClient
Client = __webpack_dev_server_client__;
} catch (e) {
// this SockJSClient is here as a default fallback, in case inline mode
// is off or the client is not injected. This will be switched to
// WebsocketClient when it becomes the default

// eslint-disable-next-line global-require
const SockJSClient = require('../clients/SockJSClient');
Client = SockJSClient;
}

Expand Down

0 comments on commit eb69e4c

Please sign in to comment.