2

How can I exclude an Erlang module from compilation in rebar3?

It should be included or excluded based on profiles.

nextloop
  • 61
  • 4

1 Answers1

1

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.

nextloop
  • 61
  • 4