Roots Discourse

How to add EventSource polyfill to WebPack?

Hi there,

I got some JS code not working properly in MS Edge. Ughhh… I get “webpack-hot-middleware’s client requires EventSource to work. You should include a polyfill if you want to support this browser” in the console and I figure out that I need a polyfill (i.e. eventsource-polyfill npm) but I have no clue how to add it to Webpack.

I tried adding to ‘main.js’ but get the same error in console.

Any help would be more than appreciated.

Thanks!