I used to do this with my animations back when I used RPG Maker, though I don't really see the point. The file size will be bigger in general if you had all frames added in.
Though simple code such as:
image image_name:
animation
"images/animation_frame_1.webp"
pause 0.03
"images/animation_frame_2.webp"
pause 0.03
repeat
Would do the trick.