magic-akari / seamless-scroll-polyfill

Scroll Behavior polyfill
https://www.npmjs.com/package/seamless-scroll-polyfill
MIT License
159 stars 12 forks source link

Arrow function prevents this to work in IE11 #99

Closed lfuelling closed 4 years ago

lfuelling commented 4 years ago

Hi,

I'm trying to use this polyfill in IE11 and get syntax errors because there is an arrow function in the code and IE11 doesn't support those.

I might create a PR for this in the next few hours.

lfuelling commented 4 years ago

To anyone having the same problem:

You can simply replace import('seamless-scroll-polyfill') with import('seamless-scroll-polyfill/dist/es5/seamless.js') to use the ES5 version.

magic-akari commented 4 years ago

Hello,

    "main": "dist/es5/seamless.js",
    "umd:main": "dist/umd/index.js",
    "module": "dist/esm/index.js",

In the package.json, the main field is target to es5 dist. And the umd dist is in es2018 format. Would you mind to provide the scaffold settings such as webpack.config.js?

lfuelling commented 4 years ago

Hi, in my case (using parcel) the module field is imported, not the main field. But it works just as well with the explicit import mentioned above.