3 ms·
Beware that there is some impact with both generating large Lottie files and especially with bundling. It is all too easy - if you are webpacking all of your as
by julik 5y ago
Beware that there is some impact with both generating large Lottie files and especially with bundling. It is all too easy - if you are webpacking all of your assets together - to suddenly have 1kb of useful code and 200+ kb of animations. I've seen it happen also that Lottie animations got fed into Babel inside of the Webpack pipeline leading to the node process quitting due to lack of memory.
Might partly have to do with the addiction of JS folks to bundle everything into one file, but it might be a good idea to `fetch()` your lottie animations lazily when you actually need to display them.
- ahuth 5y agoGood point about lazily fetching some animations can be a good idea. Not sure that all, most, or even many JS folks are addicted to bundling everything into one file.
- jawishhameed 5y agoThat's a real pro-tip! Lottie animation JSONs are better left out of the bundling and loaded dynamically. We built dotLottie[1], a little superset encapsulation layer ontop of Lottie as an experiment/solution to make it easer to bundle multiple Lotties and any associated assets AND make distribution/CDN use simpler. There are several sites that are using it now with good success. 1. https://dotlottie.io/ https://dotlottie.io/