How to uglify code when using build.phonegap?


If I run ionic build --prod --release, it minify/uglify and then builds, it works perfect.

However, I am using build.phonegap to build (since I do not have a mac computer for iphone).

I’m sending the contents of the www folder (along with resources and config.xml) to that service and it builds for either platform, and everything runs properly, but the code is not uglified.

Is there someway that I can uglify the code before I send it to build.phonegap?

Thank you.


From your explanation, try doing the --prod (via ionic)

THEN uploading that www folder to phonegap build. Should work in phonegap build just like the existing www folder without --prod

I used to use Phonegap build on Ionic 1… but havent needed to do so on Ionic 2… (yet!) [Hence why I am saying TRY…, but fairly confident!]


Thank you @alexb ! That worked perfectly.

Doing the android --prod uglified the www code, which I then sent to build.phonegap, and it worked exactly like I wanted it to.