Their Annual Plan with spending breakdown is published every year on wikimediafoundation.org. The draft for the upcoming year is https://meta.wikimedia.org/wiki/Wikimedia_Foundation_Annual_...
TL;DR: the largest chunk of the budget goes to the two departments that do engineering/design/PM/data science.
On your last point ("for all we know most of their staff time is off building stuff like Wiktionary") it's actually a big gripe in the smaller communities that probably 90% of the time and attention goes to Wikipedia.