How to minify app.js?

I tried to minify the app.js using: JScompress but it broke my app completely. Are there any standard procedure and techniques to minify app.js?

Just run your build with --release flag (or something like this)