Write custom Mix.Task.Compiler and then it can generate whatever file you want after compilation.
Mix.Task.Compiler