首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Ionic2需要30秒才能加载应用程序

Ionic2需要30秒才能加载应用程序
EN

Stack Overflow用户
提问于 2017-07-10 13:57:04
回答 2查看 450关注 0票数 3

使用ionic2和angular2,我们构建了几乎13-14个特性/模块。

使用8-10第三方npm相关模块和离子插件.

Packge.json

代码语言:javascript
复制
 {
      "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"
    }

离子信息

代码语言:javascript
复制
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解决这个问题。欢迎各位提出任何建议或建议。

EN

回答 2

Stack Overflow用户

发布于 2017-07-11 23:34:32

正如@Dhyey所提到的,除了在构建时使用标志--prod缩小文件之外,您还可能希望使用Ionic CLI标志--aot执行提前编译 (应该同时使用v2 ionic build和v3 ionic cordova build命令)。

正如您所提到的,延迟加载确实只在v3中可用(并且仍然被标记为beta/实验性),但是仅使用AOT和小型化就可以减少应用程序的大小/启动时间。

票数 0
EN

Stack Overflow用户

发布于 2017-07-13 05:50:26

只需遵循以下链接:

我向您保证,在下面的链接/文档之后,您一定会得到肯定的结果(至少90%)

应用程序启动时间问题

Ionic2需要将近30秒的时间来加载应用程序

在更新你的离子和角度版本之后。你需要跟随懒惰加载

做完以上修改后,我的应用程序引导从20秒减少到13秒。

谢谢。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45013964

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档