airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
29.85k stars 2.85k forks source link

fix(package.json) : support esm #2989

Closed stephenhebert closed 1 year ago

stephenhebert commented 1 year ago

Package.json currently only specifies a main package entry which points to a UMD file. The ESM build files are located in ./build/player/esm and should be specified with the "module" option.

stephenhebert commented 1 year ago

This issue currently causes ES imports to fail with this error: The requested module '/node_modules/lottie-web/build/player/lottie.js?v=68b5337f' does not provide an export named 'default'

bodymovin commented 1 year ago

thanks!

h615861768 commented 1 year ago

This change need fix the following usage import('lottie-web').then(lottie => { lottie. loadAnimation(xxx) });

2992