Two of the most discussed lottie-web GitHub issues are its size and a bundler warning: "Use of eval in node_modules/lottie-web/build/player/lottie.js is strongly discouraged". Both come from the same design choice: the default build supports everything.
What is in the full build
The default lottie.min.js includes the SVG, canvas and HTML renderers and the code that evaluates After Effects expressions at runtime. Expressions need eval, which triggers warnings in Vite and other bundlers and can conflict with a strict Content Security Policy.
We measured the files published in lottie-web 5.13.0 on jsDelivr: lottie.min.js is about 306 KB, lottie_svg.min.js about 243 KB and lottie_light.min.js about 168 KB. These are minified sizes before gzip or Brotli, which cut the transfer size a lot.
Switch to the light build
import lottie from 'lottie-web/build/player/lottie_light';The light build has only the SVG renderer and no expression support, and it contains no eval call. If your animations were exported without expressions, they play the same. Test each file after switching.
Other ways to cut weight
Lazy-load the player for animations below the fold. Use dotLottie files, which are compressed. Or try a player built on a WebAssembly renderer, such as dotlottie-web, and measure it in your own app. Measure with your real bundle rather than trusting any single number, including ours.