How to build beats excluding unwanted modules?

Continuing the discussion from Beats for embedded devices?:

I want to use Filebeat on an embedded device where disk is limited.
Linked topic is the answer of my question, but outdated.
I'm looking for how to build minimum beats from latest source.