I\'m using Webpack and Babel to build and transpile my ES6 code. However I am missing important Polyfills when trying to support older browsers. e.g iOS8.
Here\'s my
First of all, you're trying to add a polyfill for a web/DOM standard, not a JS polyfill. Babel only handles transpiling and polyfilling the standard ECMAScript language features, it does not handle web/browser specifications, like fetch. So you shouldn't load it with the babel loader in Webpack.
I've tried the other solutions offered here myself, but none of them works anymore. What worked for me was simply installing the package npm i whatwg-fetch --save-dev then adding it in the entry configuration option field, like this:
module.exports = {
entry: ["whatwg-fetch", "./src/yourapp.js"]
}
Where ./src/yourapp.js should be the entry point of your app.
I'm posting this in case someone will run into the same issue and the other solutions won't work.