Skip to content

Running ngcc in postinstall. Angular CLI should not run as part of the build step #38216

@Rush

Description

@Rush

🐞 bug report / feature request

This issue is a follow up to #35000

Affected Package

@angular/compiler-cli

Is this a regression?

Maybe - #35000

Description

The advice in #35000 (comment) from @Toxicable was to set up a postinstall hook like so:

If you run ngcc yourself beforehand then the angular cli wont run it as part of it's build step.
That should solve you issue of building multiple apps in parallel

"postinstall": "ngcc  --create-ivy-entry-points --properties es2015 browser module main",

the angular cli wont run it as part of it's build step. <- this is the key part I would expect to happen but it doesn't seem to be the case. as I see ngcc being run in my build for every webpack build

Another process, with id 44, is currently running ngcc.
--
5 | Waiting up to 25s for it to finish.
6 | Another process, with id 124, is currently running ngcc.
7 | Waiting up to 25s for it to finish.
8 | Another process, with id 44, is currently running ngcc.
9 | Waiting up to 25s for it to finish.
10 | Another process, with id 117, is currently running ngcc.
11 | Waiting up to 25s for it to finish.
12 | Another process, with id 58, is currently running ngcc.
13 | Waiting up to 25s for it to finish.
14 | Another process, with id 44, is currently running ngcc.
15 | Waiting up to 25s for it to finish.

Unfortunately when CI is busy with other work the max retries is used up and the build fails. We have about 10 parallel builds of different flavors of our Angular App so there is A LOT of parallelism going on.

Would it be possible to disable NGCC in ngtools/webpack builds when the dependencies have already been compiled before? @Toxicable @petebacondarwin @AndrewKushnir @gkalpak

🌍 Your Environment

Angular Version:
Angular: 9.1.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions