Exclude demos from mini builds

Fixes #17750.

(cherry picked from commit 91916e77967e485182e753b7513c80efd84b926b)