I have my application build in asp.net core spa with aurelia and webpack (based on Rob Eisenberg's tutorial). It runs perfectly on chrome and firefox, but in IE, which is the main browser that I need to support, it has issues with hot module reload. I get this error:
webpack-hot-middleware's client requires EventSource to work. You should include a polyfill if you want to support this browser
I ran npm install event-source-polyfill
In devdependencies of package.json
, I added:
"webpack-hot-middleware": "^2.18.0",
"event-source-polyfill": "^0.0.12"
Then in my webpack.config.js
, I added
module.exports = {
entry: ['app': ['event-source-polyfill', 'aurelia-bootstrapper'],
// ...
};
as suggested here: https://github.com/jods4/aurelia-webpack-build/wiki/Polyfills
I also added
new webpack.ProvidePlugin({
es: 'event-source-polyfill'
}),
inside plugins
of webpack.config.js
Then I imported import 'event-source-polyfill/src/eventsource.min.js'
.
My event-source-polyfill
lives inside node-modules folder. Should I manually copy it somewhere?
Then how do I actually use it?
I do not know what to do in aurelia to tell it to use this polyfill for IE. So far the error is still the same.