离子构建:--prod和--release标志之间的区别? [英] Ionic build: difference between --prod and --release flags?
问题描述
运行ionic build
时,我好奇--prod
和--release
标志之间的区别吗?
When running an ionic build
I'm curious as to the difference between the --prod
and --release
flags?
离子构建文档状态:
-产品构建用于生产的应用程序
-发行版创建Cordova发行版
--prod Build the application for production
--release Create a Cordova release build
,而 Cordova CLI ref 没有提及--prod
标志,它为--release
声明了以下内容:
and while the Cordova CLI ref doesn't mention a --prod
flag, it states the following for --release
:
执行发行版本.这通常会转换为以下内容的发布模式 正在构建的基础平台.
Perform a release build. This typically translates to release mode for the underlying platform being built.
考虑构建输出中的差异,使用--prod
进行构建似乎会运行 Ionic 生产"构建,因为它还会运行ngc
和uglify
(它们本身运行cleancss
)任务.
Looking at the difference in the build output, building with --prod
seems to run an Ionic 'production' build, in that it also runs the ngc
and uglify
(which itself runs cleancss
) tasks.
当我使用--release
运行构建时,我似乎得到了 Cordova 发行版本,该版本(根据文档)尝试在目标平台上运行发行版本.
And when I run a build with --release
, I seem to get a Cordova release build, which (per the docs) attempts to run a release build on whatever platform you're targeting.
是唯一的区别,还是我过于简化了?
Are those the only differences, or am I over-simplifying?
作为参考,请注意以下输出APK文件大小:
For reference, note the following output APK filesizes:
- 产品标志:9.8 MB
- 释放标志:11.7 MB
- 产品+发行标志:8.9 MB
我正在使用Ionic Framework(3.9.2)和CLI(3.20.0)的最新(ATTOW)版本.
I'm using the latest (ATTOW) version of the Ionic Framework (3.9.2) and CLI (3.20.0).
推荐答案
Prod优化代码,Release使代码以不同的方式构建,因此 该应用可以发布到商店.您必须同时使用两者 可以发布的版本.
Prod optimizes the code, Release makes it build in a different way so the app can be released to the stores. You have to use both for a fast version that can be released.
正如Sujan12在
As Sujan12 says on this link.
这篇关于离子构建:--prod和--release标志之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!