Ionic 3 and Firebase --prod build freezing

Hi, I have an issue with creating --prod build for android with firebase. A build just freezing if we use --prod flag or --optimizejs flag. I am using angularfire2, and the plugin developers said that is ionic cli bug, how to solve it?