It's definitely more than $20 million, though nowhere near $40 million. Even medium sized shows with a smaller cast and crew and much simpler sets and costumes than Shrek easily get into the $12-$14 million dollar range.
A lot of people seem to feel that just because a musical is expensive, the quality is low. I've been impressed with how the producers and creative team have been working to make the show the best it can be, including a very expensive revamp since the out-of-town version (if only Disney would take note).
And remember, they have more movies coming out so while they do want to sell tickets and be a hit, they don't care as much if their nut is higher since it's just as much about brand awareness as it is making a profit. Much more so than with other shows.
Broadway is at it's best when there are huge, spectacle shows and smaller, more daring shows running side by side.
If the audience could do better, they'd be up here on stage and I'd be out there watching them. - Ethel Merman