I am new to Ionic, recently I developed One app.But my app size was 8mb. How should I reduce app size,and I am not using any Images and plugins also, but it took 8mb size. please help me.
2 Answers
For production builds you can use ionic cordova build [android/ios] --prod --release
. This can reduced the size of your application.
The prod
and release
flags will minify code and remove debugging utilities.
Documentation: https://ionicframework.com/docs/intro/deploying/#production-builds
You can use one of $ ionic cordova build options
- --no-build - Do not invoke an Ionic build
- --prod - Build the application for production
- --aot - Perform ahead-of-time compilation for this build
- --minifyjs - Minify JS for this build
- --minifycss - Minify CSS for this build
- --optimizejs - Perform JS optimizations for this build
- ...
For example: ionic cordova build android --prod --aot