Skip to content

Commit 9321d5c

Browse files
authored
Fix: browser compatibility Merge pull request #268 from ajinkyarajput/ajinkyarajput-url-import
Make it browser compatible
2 parents 4579961 + a759bc5 commit 9321d5c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

HISTORY.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# [2.0.1](https://github.com/EventSource/eventsource/compare/v2.0.0...v2.0.1)
2+
3+
* Fix `URL is not a constructor` error for browser ([#268](https://github.com/EventSource/eventsource/pull/268) Ajinkya Rajput)
4+
15
# [2.0.0](https://github.com/EventSource/eventsource/compare/v1.1.0...v2.0.0)
26

37
* BREAKING: Node >= 12 now required ([#152](https://github.com/EventSource/eventsource/pull/152) @HonkingGoose)

lib/eventsource.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var parse = require('url').parse
2-
var URL = require('url').URL
32
var events = require('events')
43
var https = require('https')
54
var http = require('http')

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"standard": {
5353
"ignore": [
5454
"example/eventsource-polyfill.js"
55+
],
56+
"globals": [
57+
"URL"
5558
]
5659
}
5760
}

0 commit comments

Comments
 (0)