We use playwright to capture screenshots of our animated SVG (or really anything that can be loaded into a browser), then use sharp to convert pngs into webps, then node-webpmux to create the animated webp.
- Install dependencies
yarn ts-node capture.tsyarn ts-node writeWebP.ts