Manipulating compiler-output with scripts works perfectly well - we could make a bunch of those in a Git-repo to support various browser APIs, fix issues, and make performance-improvements.
elm-optimize-level-2 sort of does this
I do this a lot instead of asking for work elsewhere