2017-07-10 13 views
5

ionic2 और angular2 हम लगभग 13-14 सुविधाओं/मॉड्यूल का निर्माण का उपयोग करते हुए लोड करने के लिए 30 सेकंड तक ले जाता है।Ionic2 एप्लिकेशन

प्रयुक्त 8-10 तृतीय पक्ष NPM depenedencies और आयनिक प्लगइन्स।

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 के साथ इस मुद्दे को हल करने के लिए। किसी भी सुझाव या सलाह के लिए दोस्तों का स्वागत है।

+0

क्या यह पहली बार या लाइव रीलोड के लिए भी है? –

+0

न केवल पहली बार, ऐप को लोड करने के लिए हमेशा यादृच्छिक समय लगता है –

+0

'ऐप लोड करने' से आपका क्या मतलब है? क्या आपका मतलब मोबाइल डिवाइस पर खोलना है, यदि हां, तो कौन सा। – IonicBurger

उत्तर

0

जब निर्माण झंडा --prod का उपयोग कर अपने फ़ाइलों को कम करने के अलावा, @Dhyey से उल्लेख किया है, आप भी आयोनिक CLI झंडा --aot का उपयोग कर (दोनों v2 ionic build और v3 ionic cordova build आदेशों के साथ काम करना चाहिए) Ahead-of-Time compilation क्या करना चाहते हो सकता है।

जैसा कि आपने बताया है, आलसी लोडिंग वास्तव में केवल v3 में उपलब्ध है (और अभी भी बीटा/प्रयोगात्मक के रूप में टैग की गई है) लेकिन एओटी और अकेले कमीशन को आपके ऐप के आकार/स्टार्टअप समय को कम करना चाहिए।

0

बस नीचे दिए गए लिंक का पालन करें:

मैं नीचे दिए गए लिंक/डॉक्स निम्नलिखित आप निश्चित रूप से परिणाम हो जाएगा (कम से कम 90%)

Issue with app boot time

Ionic2 takes almost 30 sec to load app

अद्यतन करने के बाद के बाद आपको विश्वास दिलाता हूं अपने आयनिक और कोणीय संस्करण। आपको Lazy Loading का पालन करना होगा।

ऊपर करने के बाद बदल जाता है मेरे ऐप बूट 20 सेकंड से 13 सेकंड के लिए कम।

धन्यवाद।

संबंधित मुद्दे