Skip to content

Commit 34f4d91

Browse files
committed
fixup! build: remove ngcc postinstall patch in favor of separate script
Address feedback
1 parent b6dfa76 commit 34f4d91

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

tools/bazel/update-ngcc-main-fields.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
/**
2-
* Script that runs after node modules have been installed, and NGCC processed all packages.
3-
* This script updates the `package.json` files of `@angular` framework packages to point
4-
* to the NGCC processed UMD bundles. This is needed because we run Angular in a `nodejs_binary`,
5-
* but want to make sure that Ivy is being used. By default, the NodeJS module resolution will
6-
* load the unprocessed UMD bundle, so we update the `main` field in `package.json` files to point
7-
* to the Ivy UMD bundles.
2+
* Script that runs after node modules have been installed, and Ngcc processed all packages.
3+
* This script updates the `package.json` files of Angular framework packages to point to the
4+
* Ngcc processed UMD bundles. This is needed because we run Angular in a `nodejs_binary`, but
5+
* want to make sure that Ivy is being used. By default, the NodeJS module resolution will load
6+
* the unprocessed UMD bundle because the `main` field of the `package.json` files point to the
7+
* View Engine UMD bundles. This script updates the `main` field in `package.json` files to point
8+
* to the previously generated Ivy UMD bundles.
9+
*
10+
* Ngcc does not by edit the `main` field because we ran it with the `--create-ivy-entry-points`
11+
* flag. It instructs Ngcc to not modify existing package bundles, but rather create separate
12+
* copies with the needed Ivy modifications. This is necessary because the original bundles
13+
* are needed for View Engine, and we want to preserve them in order to be able to switch
14+
* between Ivy and View Engine (for testing). Since the goal of this flag is to not modify
15+
* any original package files/bundles, Ngcc will not edit the `main` field to point to
16+
* the processed Ivy bundles.
817
*/
918

1019
const shelljs = require('shelljs');

0 commit comments

Comments
 (0)