window.EventSourcePolyfill = require('./eventsource')
window.EventSource = window.EventSource || window.EventSourcePolyfill

var EventSource = require('./eventsource')
if (typeof window === 'object') {
  window.EventSourcePolyfill = EventSource
  if (!window.EventSource) window.EventSource = EventSource
}

Check window object exists before polyfilling
Check window object exists before polyfilling
