Tasks for production prepared Ionic app

时光总嘲笑我的痴心妄想 提交于 2019-12-03 14:13:45

Try ionic-app-scripts >= 0.0.48 to config build.

Production:

ionic build android --prod

To check the minified file, open the apk file with GNOME Archive Manager (or similiar) and extract /assets/www/build/js/app.bundle.js file.

Preparing an Ionic Cordova app for release in production

1. Building

In your terminal execute the following command according to your platform (android / ios):

ionic build android --prod --release

2. Releasing

In order to be able to install a production application on a device and furthermore in order to be able to publish it in app stores, your .apk or .ipa file needs to be signed. How you do that depends on the platform.

Here is the procedure in detail for Android and for iOS.


Preparing an Ionic Progressive Web App (PWA) for release in production

1. Building

In your package.json file, you should make sure to have something like the following:

"scripts": {
     // ...
     "build:www": "rm -rf www && ionic-app-scripts build --prod",
     // ...
},

Now in your terminal run:

npm run build:www

2. Releasing

Your app is built in the folder www ready for you to serve in production using any webserver like NginX, Apache or a custom Node + Express webserver.


Valid as of Ionic v3.3

Learn more about ionic-scripts, what they do and which other scripts you could possibly find useful.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!