Can anybody tell me what…
Can anybody tell me what’s the impact/potential issues with not having ngcc on postinstall? It adds a huge amount of time to my CI pipeline… and given the issues I’ve mentioned yesterday on gitlab, this is quite painful.
Responses:
Libraries using view-engine wouldn’t be compatible with Ivy code. And untill ng10, it’s recommented to use view engine for libraries
Ok I see; but in the context of a pure CI (test, lint, build, etc), is it an issue?
I mean, would it be enough/would it make sense to only execute ngcc when building the prod version or running e2e tests?
I think so, you probably don’t need those when you use shallow rendering in your unit tests or for linting
I would say give it a try and see. There are cases where you could pass over a bug because your test was using a view engine lib even though the ngcc compiled version is used in production.
Sebastian, another I idea I have which is something we do is (we use circle so might be slightly different terminology) attempt to restore the node modules based on hash if exists go to next step otherwise install. Then we persist those between jobs like you are doing now. This one you only run ngcc if your lock file has changed and need to reinstall. Otherwise the ngcc compiled versions are saved with the cache that is attempted to be restored at the start. We found this was a nice middle ground between restoring a cache every step and needing to install in every workflow.
Thanks !
I’ve spend a few hours yesterday evening trying to improve the situation. I’ve gained quite a lot of build time by creating my own Dockerfile for the CI build. I’ve installed all the packages, Cypress and prepared the npm cache in it
Now my whole pipeline time is down from one hour to ~20 minutes :slightly_smiling_face: