Skip to content

Commit

Permalink
fix(neffos.js): Only import node websocket package conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
alpjor committed Jan 8, 2024
1 parent 258c1da commit 80efd36
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions dist/neffos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/neffos.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/neffos.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/neffos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ var WebSocket = (typeof WebSocket !== 'undefined') ? WebSocket : undefined;
// Nowadays node has its own textdecoder and encoder.
// import {TextDecoder, TextEncoder } from 'util';

import * as nodeWS from 'ws';

if (!isBrowser) {
WebSocket = nodeWS.WebSocket;
WebSocket = require('ws');
} else {
WebSocket = window["WebSocket"];
}
Expand Down

0 comments on commit 80efd36

Please sign in to comment.