The build toolset we use (npm + grunt + dojo) doesn't properly handle minified libraries. We've noticed that it mangles names of dependencies, which results in dependencies not being loaded properly at runtime.
We advise people to use unminified versions of libs for a few reasons:
My incomplete toughts upon this issue.
Mendix parses and processes the javascript files itself and tries to get all AMD lib references/define/require. This parsing can not handle minified versions because that would require a full javascript interpreter.
This is done to include 'cache' statements to improve the performance. According to your code it seems that it create a local scope for dojo, etc
That does not answer your question, but in my opinion it is a bug that it wraps the code.
In some widgets I found Mendix incorrectly notifying me of missing libraries. You can fool the parser by copying the define function into a local var and call that var instead of define. Mendix will not recognize that and allows running in the cloud.