【问题标题】:Ionic won't build if --prod specificed如果 --prod 指定,离子将不会构建
【发布时间】:2018-06-13 20:22:32
【问题描述】:

我想构建我的应用程序的 Web 版本,并在添加浏览器平台后启动了 Ionic build --prod 命令。

我的输出:

> ionic build --prod
Running app-scripts build: --prod
[09:32:57]  build prod started ...
[09:32:57]  clean started ...
[09:32:57]  clean finished in 58 ms
[09:32:57]  copy started ...
[09:32:58]  deeplinks started ...
[09:32:58]  deeplinks finished in 164 ms
[09:32:58]  ngc started ...
[09:33:14]  ngc finished in 16.15 s
[09:33:14]  preprocess started ...
[09:33:14]  preprocess finished in 4 ms
[09:33:14]  webpack started ...
[09:33:14]  copy finished in 16.98 s

我已经让这个过程至少持续了一个小时,但它从来没有进展过。我没有收到任何错误消息,但它永远不会进展。知道如何构建项目吗?

我正在使用 Ionic CLI 3.20.0 和 Angular 5.2.10。

【问题讨论】:

  • 检查你的内存。如果 Node.js 占用了你所有的 RAM。
  • 我有大约 6 Gb 的空闲空间。惊讶地发现它使用了大约 600Mb 的内存。
  • Ionic 几乎不能用于任何版本的 Angular。您应该参考文档以了解哪些特定版本的 Ionic 可以与哪些特定版本的 Angular(经过良好测试)一起使用。使用推荐版本以外的任何版本都可能导致您不想避免的雪花效果。
  • 不支持 5.2.10 吗?这是来自 Ionic-Cli 的。我还没有升级它
  • 我已经测试过了,它可以工作。最初它冻结在“16.98 秒完成的副本”中,但经过一段时间的进展

标签: ionic-framework ionic3


【解决方案1】:

要运行或构建,您必须使用

ionic cordova run android --prod --release

ionic cordova build android --prod --release

请同时参考文档https://ionicframework.com/docs/intro/deploying/

【讨论】:

  • 试过 ionic cordova build browser --prod --release 。挂在完全相同的位置。
猜你喜欢
  • 1970-01-01
  • 2018-02-10
  • 2018-09-09
  • 1970-01-01
  • 1970-01-01
  • 2021-02-13
  • 2018-01-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多