Skip to content

Commit 4a11420

Browse files
HeadPatrickJS
authored andcommitted
fix problem when using webpack (#83)
* fix problem when using webpack Fixed issue #82 * Update angular-websocket.js
1 parent 5f3d16b commit 4a11420

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dist/angular-websocket.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
var Socket;
3535

36-
if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && typeof require === 'function') {
36+
if (typeof window === 'undefined') {
3737
try {
3838

3939
Socket = ws.Client || ws.client || ws;
@@ -412,4 +412,4 @@
412412

413413
exports.default = _angular2.default.module('ngWebSocket');
414414
module.exports = exports['default'];
415-
});
415+
});

src/angular-websocket.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import angular from 'angular';
22

33
var Socket;
44

5-
if (typeof exports === 'object' && typeof require === 'function') {
5+
if (typeof window === 'undefined') {
66
try {
77
var ws = require('ws');
88

0 commit comments

Comments
 (0)