LoginSignup
7
7

More than 5 years have passed since last update.

Ionic3 のアプリ起動を高速化する

Last updated at Posted at 2017-06-30

Ionic3で普通に「build」したアプリの起動時間が4〜5秒ぐらいかかる。
テンプレート「blank」とかで作った最もシンプルなものでも遅い。
最低でも3秒以下にしたいなと思って調べたら、実にカンタンに高速化できました。

環境

Ionic3

対応

ビルド時にAoTコンパイルするようにする

AoTについては、以下の資料がわかりやすい。

やり方

「--prod」を付けてビルドする

androidアプリの場合
ionic cordova build android --release --device --prod
iosアプリの場合
ionic cordova build ios --release --device --prod

結果

(Android, iOS共に)
AoT前: 4秒 ⇒ AoT後: 2秒

ざっと2倍に! (^O^)

補足: AoTは使いたいが、JSのMinifyはしたくない場合

「--aot」を付ける

ionic emulate ios --aot
7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7