Ionic2 takes up to 30 seconds to download an application

Using ionic2 and angular2, we create almost 13-14 functions / modules.

It uses 8-10 third-party npm dependencies and ion plugins.

Packge.json

{ "name": "Yugma", "author": "NxtLife Team", "homepage": "http://www.nxtlifetechnologies.com/", "private": true, "scripts": { "build": "ionic-app-scripts build", "watch": "ionic-app-scripts watch", "serve:before": "watch", "emulate:before": "build", "deploy:before": "build", "build:before": "build", "run:before": "build", "postinstall": "typings install" }, "dependencies": { "@angular/common": "2.2.1", "@angular/compiler": "2.2.1", "@angular/compiler-cli": "2.2.1", "@angular/core": "2.2.1", "@angular/forms": "2.2.1", "@angular/http": "2.2.1", "@angular/platform-browser": "2.2.1", "@angular/platform-browser-dynamic": "2.2.1", "@angular/platform-server": "2.2.1", "@ionic-native/camera": "^3.4.4", "@ionic-native/core": "^3.1.0", "@ionic-native/file": "^3.4.4", "@ionic-native/file-chooser": "^3.4.4", "@ionic-native/transfer": "^3.4.4", "angular2-moment": "^1.0.0-beta.rc.1", "intl": "^1.2.5", "ionic-angular": "2.2.0", "ionic-gallery-modal": "^0.1.1", "ionic-native": "^2.2.3", "ionic2-calendar": "^0.2.4", "ionic2-rating": "0.0.10", "ionicons": "3.0.0", "nxtlife-ionic2-rating": "^1.0.3", "rxjs": "5.0.0-beta.12", "sw-toolbox": "3.4.0", "typings": "1.3.1", "underscore": "^1.8.3", "zone.js": "0.6.26" }, "devDependencies": { "@ionic/app-scripts": "^1.1.4", "typescript": "2.0.6" }, "cordovaPlugins": [ "cordova-plugin-whitelist", "cordova-plugin-statusbar", "cordova-plugin-device", "cordova-plugin-console", "ionic-plugin-keyboard", "cordova-plugin-splashscreen" ], "cordovaPlatforms": [], "description": "NxtLifeYugma2: An Ionic project" } 

Ion information

 Cordova CLI: 6.5.0 Ionic Framework Version: 2.2.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.3.7 ios-deploy version: Not installed ios-sim version: Not installed OS: Linux 4.9 Node Version: v6.10.3 Xcode version: Not installed 

Too many disappointments to solve this problem with ionic2. Guys are most welcome for any suggestion or advice.

+3
source share
2 answers

As @Dhyey mentioned, in addition to shrinking your files using the --prod flag when creating, you might also want to do Ahead-of- Time compilation using the Ionic CLI flag --aot (should work like with the v2 ionic build commands, so with v3 ionic cordova build )).

As you mentioned, lazy loading is really only available in version 3 (and is still labeled beta / experimental), but AOT and only minimization reduce the size of your application / startup time.

0
source

Just follow the links below:

I assure you that after the following links / documents you will get a certain result (at least 90%)

Problem with application load time

Ionic2 takes about 30 seconds to download the application

After updating your ionic version and angular version. You need to follow Lazy Loading .

After making the above changes, the download of my application is reduced to 13 seconds from 20 seconds.

Thanks.

0
source

Source: https://habr.com/ru/post/1269671/


All Articles