2017-07-10 11 views
5

ionic2とangular2を使用して私たちはほぼ13-14個の機能/モジュールを構築します。Ionic2はアプリケーションをロードするのに最大30秒かかります

使用されている8-10サードパーティnpm依存性およびイオン性プラグイン。

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" 
    } 

イオン性情報

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 

多すぎると不満をionic2でこの問題を解決します。 ご意見やアドバイスをお待ちしております。 @Dhyeyで述べたように

+0

これは初回のみですか、ライブリロードですか? –

+0

初回だけでなく、いつもアプリをロードするのにランダムな時間がかかります –

+0

「アプリを読み込む」という正確な意味は?モバイルデバイスで開くことを意味しますか? – IonicBurger

答えて

0

は、構築時にフラグ--prodを使用してファイルを縮小化に加えて、あなたも(V2 ionic buildおよびv3 ionic cordova buildコマンドの両方で動作するはずです)イオンCLIフラグ--aotを使用してAhead-of-Time compilationをしたいかもしれません。

あなたが述べたように、遅延ロードはv3では実際にのみ使用可能です(まだ実験的なベータ/としてタグ付けされた)が、単独のAOTと縮小は、アプリケーションのサイズ/起動時間を減少させるはずです。

0

ただ、リンクの下には、次のとおりです。あなたを更新した後

私はあなたが(少なくとも90%)の結果は間違いなくなりますリンク/ドキュメントの下に、次の後にあなたを保証

Issue with app boot time

Ionic2 takes almost 30 sec to load app

イオンと角のバージョン。 Lazy Loadingに従う必要があります。

上記の変更を行った後、アプリの起動が20秒から13秒に短縮されます。

ありがとうございます。

関連する問題