Ionic applications taking too long to load

I created a simple app with no extras plugins or anything special but it’s taking too long to load. It opens the splash screen, fades it and after that takes about 5-10 seconds to display the first page.
I read some posts and could not find a good explanation for this issue.

What can be done?

if you’re building the app locally using the ionic build command are you using the --prod key?

ionic cordova build whichever --prod

I usually build with This delay occurs even changing build version to 2 with

<preference name="pgb-builder-version" value="2" />

Building it locally and with --prod seems to fix it. Any tip about building with
Thanks by now

I’d start by saying quit with Phonegap Build right now. After a few hours’ pain with Ionic Pro you’ll have SO much of a better time of it. The service is built for what you’re trying to do.

However if you insist, you are probably (???) checking in your bundles into phonegap using either Git or upload directly, and those bundles are not using the --prod switch.

You can see this on your bundle if you download your apk/ipa file from phonegap and extract (they’re basically zip files). Look inside the www/build folder and take a note of how large your .js files are, in particular main.js.

If you’re doing it using git, presumably you have removed the www folder from .gitignore and are building directly off that…?

In any case update your package.json file’s scripts section - change the build entry to look like…

"build": "ionic-app-scripts build --prod",

When you want to send your content to phonegap, run the following command…

npm run-script build

Then upload to phonegap - and create your ipa/apk using that. If you do you should see a MUCH smaller www/build payload size - along with a much reduced load time.

Tell me if I’m wrong!