vigetlabs / blendid

A delicious blend of gulp tasks combined into a configurable asset pipeline and static site builder
MIT License
4.97k stars 685 forks source link

Babel autoprefixer to support IE10 #558

Closed farissi closed 5 years ago

farissi commented 6 years ago

Hello, I'm looking for the correct way to enable polyfill for IE10 to support ES6 syntax. I'm using fetch to make call an api and getting this error on IE10: jQuery.Deferred exception: 'fetch' is undefinedReferenceError: 'fetch' is undefined

Thank you!!

brianjhanson commented 5 years ago

Not a maintainer here, but you probably want to use something like whatwg-fetch to polyfill window.fetch which isn't supported in IE. It is intentionally not included in babel-polyfill.

Hope that helps!

olets commented 5 years ago

@farissi quick background: task-config's javascripts.babel or javascripts.babelLoder.options is used as the babelLoader options in the Webpack config.

For general IE10 support, you should be able to use targets ie 10 as documented at https://babeljs.io/docs/en/babel-preset-env

Note the IE10 limitations in https://babeljs.io/docs/en/caveats

For window.fetch you might also check out https://github.com/github/fetch, recommended by zloirock the core-js maintainer. I haven't used fetch or whatwg-fetch.

Closing because this seems to not be a Blendid issue, but 👍 feel free to reopen if I'm wrong about that!