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

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

问题描述

我试图找出从代码传递给最终可部署的apk / ipa的最好的进程。

远远我有一个使用Karma + Jasmine的测试套件,它将TypeScript转换为JS并运行一些单元测试。我通过喝酒开始这个过程。

之后,我所知道的是离子构建android --release 什么生成(一个未签名的apk)。
但我不确定如何破解/缩小生成的apk。



因此,请记住代码必须尽可能隐私,对离子建造的缩小和破坏是否足够了,还是应该通过大量的手工来完成所有这些预建任务?
在这种情况下,我应该运行什么样的正确任务,是否必须手动将所有TypeScript文件转换为JS?我应该以什么顺序运行这些任务?



例如, transpile - >测试 - >缩小 - > uglify - >构建apk minify - > uglify - > transpile - >测试 - >构建apk



我有点失落了,唯一能想到的是测试应该先运行,因为在测试失败的情况下,应该放弃这个过程。 试试 ionic-app-scripts > = 0.0.48 to config build。



制作:

  ionic build android --prod 
$ b $要检查缩小的文件,用 GNOME Archive Manager (或类似)打开apk文件并提取 /assets/www/build/js/app.bundle.js 档案。


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

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.

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.

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?

E.g. transpile -> tests -> minify -> uglify -> build apk or minify -> uglify -> transpile -> tests -> build 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.

解决方案

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.

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

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