web-animations / web-animations-js

JavaScript implementation of the Web Animations API
http://web-animations.github.io
Apache License 2.0
3.77k stars 408 forks source link

polyfill can not run when script type=module #197

Open nadavsinai opened 6 years ago

nadavsinai commented 6 years ago

Heres a reproduction made by changing the script type on the official demo jsbin

I've past a long chain of issues that actually relate to this it all comes from the use of uglify wrap option that adds that window catching method of a function that returns this as @dstockwell has identified well in #46 this can no longer work in module type scripts which are not invoked with a window context

46

and info found here https://github.com/edcarroll/ng2-semantic-ui/issues/92

we use script type module on all our code targeting modern browsers with es2015 compilation

it seems to me that the solution is not to use uglify's wrap at all. At all the build is very old, would you accept a PR modernizing the build and removing this bug?