How to call a function from Mix file in production

In the mix file I have a function and a hardcoded value. This works in development when I call those from the code. But in production not because MyApp.Mixfile isn’t available in production.

I don’t want to copy code into a normal ex file and thus have the code repeated.

A function from the mix file calls “git arg1 arg2 arg3” – this also works when it’s in the mix file, but not when I call the same body on a function from console on a server in the production mode.

How to handle this?

Why do you need to call code in the mixfile from your application? This seems like a strange thing to do.


If you want to compile time encode information then a macro is the way to go. Or baking it into the application config.