用于生产准备的 Ionic 应用程序的任务 [英] Tasks for production prepared Ionic app

查看:10
本文介绍了用于生产准备的 Ionic 应用程序的任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找出从代码传递到最终可部署 apk/ipa 的最佳过程.

I'm trying to figure out what's the best process to pass from the code to the final deployable apk/ipa.

到目前为止,我有一个使用 Karma + Jasmine 的测试套件,它将 TypeScript 转换为 JS 并运行一些单元测试.我通过 gulp 开始这个过程.

So far I have a testsuite using Karma + Jasmine, which transpiles the TypeScript to JS and runs some unit tests. I start that process via gulp.

在那之后,我所知道的就是 ionic build android --release 生成(尚未签名的)apk.但我不确定生成的 apk 的滥用/缩小程度.

After that all I know is to ionic build android --release what generates (an unsigned yet) apk. But I'm not sure of how ofuscated/minificated the generated apk is.

因此,请记住代码必须尽可能私密,ionic build 的缩小和使用是否足够,或者我应该通过 gulp 手动完成所有这些预构建任务?在这种情况下,我应该运行哪些正确的任务,我是否必须手动将所有 TypeScript 文件转换为 JS?我应该以什么顺序运行这些任务?

So, keeping in mind the code has to be as private as possible, is the minification and the ofuscation of the ionic build enough or should I do all those prebuild tasks manually via gulp? And in that case, whats are the right tasks I should run, do I have to transpile all the TypeScript files to JS manually? and in what order should I run the tasks?

例如转译->测试->缩小->丑化->构建 apkminify ->丑化->转译->测试->构建apk

我对此有点迷茫,我唯一能想到的是应该首先运行测试,因为如果测试失败,则应该中止该过程.

I'm a bit lost with this, and the only thing I can figure out is that the tests should be ran first, because is case of test failure the process should be aborted.

推荐答案

试试 ionic-app-scripts >= 0.0.48 来配置构建.

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

生产:

ionic build android --prod

要检查压缩文件,请使用 GNOME Archive Manager(或类似工具)打开 apk 文件并提取 /assets/www/build/js/app.bundle.js 文件.

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.

这篇关于用于生产准备的 Ionic 应用程序的任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆