Branching in .erl based on MIX_ENV

Is it possible to use -ifdef or -if in an Erlang source file inside a mix project to determine if Mix.env() is :test, :dev or :prod?

Is it even possible to check with erlang preprocessor macros if the code is compiled by mix, or rebar3?