Tasks for getting a prepared Ion application

I am trying to figure out which best process should go from code to the final deployable apk / ipa.

So far I have testuite using Karma + Jasmine, which translates TypeScript into JS and runs some unit tests. I run this process through gulp.

After that, all I know is ionic build android --release what (unsigned yet) apk generates. But I'm not sure how the generated apk is spent / minimized.

Thus, keeping in mind that the code should be as closed as possible, is this minimization and extension of the ionic build function, or should I complete all these pre-build tasks manually through gulp? And in this case, what are the right tasks that I have to complete, do I need to translate all TypeScript files to JS manually? and in what order should I perform tasks?

eg. transpile -> tests -> minify -> uglify -> build apk or minify -> uglify -> transpile -> tests -> build apk

I lost this a bit, and the only thing I can understand is that the tests should be run first, because if the test fails, the process should be interrupted.

+8
build production-environment gulp ionic-framework ionic2
source share
2 answers

Try ionic-app-scripts > = 0.0.48 to build the configuration.

Production:

 ionic build android --prod 

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

+3
source share

Preparing Ionic Cordova for production launch

1. Construction

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

ionic build android --prod --release

2. Release

In order to be able to install a production application on the device and, in addition, so that it can be published in application stores, your .apk or .ipa file must be signed. How you do this depends on the platform.

Learn more about the Android and iOS procedure.


Preparing the Ionic Progressive Web App (PWA) for production launch

1. Construction

In your package.json file, you should make sure that you 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. Release

Your application is built in the www folder, ready for you to serve in production using any web server such as NginX , Apache or a custom Node + Express web server.


Valid with Ionic v3.3

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

0
source share

All Articles