Skip to content

Commit

Permalink
Merge pull request #62 from adzialocha/fix-dgram
Browse files Browse the repository at this point in the history
Fix `dgram` import in browser context
  • Loading branch information
adzialocha authored Apr 1, 2022
2 parents acde1a0 + 30a2657 commit 3f7bcf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugin/bridge.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const dgram = typeof __dirname !== 'undefined' ? require('dgram') : undefined
const WebSocketServer = typeof __dirname !== 'undefined' ? require('isomorphic-ws').Server : undefined
const dgram = typeof window === 'undefined' ? require('dgram') : undefined
const WebSocketServer = typeof window === 'undefined' ? require('isomorphic-ws').Server : undefined

/**
* Status flags
Expand Down
2 changes: 1 addition & 1 deletion src/plugin/dgram.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const dgram = typeof __dirname !== 'undefined' ? require('dgram') : undefined
const dgram = typeof window === 'undefined' ? require('dgram') : undefined

/**
* Status flags
Expand Down

0 comments on commit 3f7bcf2

Please sign in to comment.