C8ycli option for optimized production build

Product/components used and version/fix level:

c8ycli for building custom applications for the Cumulocity IoT platform. I’m using version 10.16, but I guess, the version is not important here.

Detailed explanation of the problem:

I want to build a custom application with c8ycli. Running c8ycli build just works fine.

However, I’m wondering how to optimize the build for production usage (deployment to Cumulocity IoT platform). The documentation of c8ycli mentions the option ‑‑env.mode="production". Thus I’ve tried c8ycli build --env.mode="production". But this alone doesn’t seem to have any effect on the resulting build.

Being more familiar with Angular, I know Angular’s option --configuration production (just -prod in earlier versions of Angular). This option combined with typical settings in angular.json produces an optimized build that is significantly smaller than a build without this option. Can we achieve something similar with c8ycli?

Hi Christian,

for the c8ycli build command the default mode is production while for c8ycli server it is development.
Running c8ycli build --env.mode="production" does not actually have any effect as it is by default already in that mode.

In case you want to have a production build during local development you can run c8ycli server --env.mode="production".
Or for a development build that you want to deploy to your tenant, you can run c8ycli build --env.mode="development".

Note that the development builds are significantly larger compared to the production ones.

Regards,
Tristan

2 Likes

Hi Tristan,
thank you for the quick and clear answer!
Best regards,
Christian

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.