Search code examples
reactjsinternet-explorer-8babeljsdefineproperty

How to transform Object.defineProperty in IE8


I use React, Webpack, Babel to build the project and wish it run in IE8, there is a problem that Object.defineProperty is not supported in IE8.

I didn't use this function but npm packages do it, like react-router. I have tried polyfill, es5-shim, es5-sham, and a lot of babel plugins, but unfortunately not work for me...

So what else can i do for this situation?

Truly appreciate.


Solution

  • Generally for support of much older browsers, you'd want to use babel-preset-es2015-loose rather than babel-preset-es2015, which will stop most usage of Object.defineProperty.