How can I exclude an Erlang module from compilation in rebar3?
It should be included or excluded based on profiles.
The solution is to add a rebar3 profile defining a macro in your rebar.config
{profiles, [{nomodulex, [
{erl_opts, [{d, 'NO_MODX'}]}
]}
]}.
And in the module add straight after the module declaration
-ifndef(NO_MODX).
and in the end
-endif.