Skip to content

Commit 58a7421

Browse files
authored
build: fix yarn install error if rules_nodejs linked local packages (#22595)
Currently if a package like `@angular/cdk` is used locally within a Bazel NodeJS action (e.g. when using with `rollup_bundle`), the Bazel NodeJS rules link the build output into the local `node_modules/` folder. This is problematic because later if `yarn` is executed, the linked packages are incorrectly included in the `angular-tsconfig.json` project (which is used for summary generation to allow for Bazel View Engine tests) We fix this by explicitly excluding our local packages to avoid errors such as: ``` info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. (warning Resolution field "[email protected]" is incompatible with requested version "typescript@^3.2.2" node_modules/@angular/components-examples/material/chips/chips-harness/chips-harness-example.d.ts:8:13 - error TS2503: Cannot find namespace 'jasmine'. ```
1 parent f19aca6 commit 58a7421

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

angular-tsconfig.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
"node_modules/@angular/common/upgrade*",
2828
"node_modules/@angular/compiler-cli/**",
2929
"node_modules/@angular/dev-infra-private/**",
30-
"node_modules/@angular/router/upgrade*"
30+
"node_modules/@angular/router/upgrade*",
31+
// We also list the packages built as part of this repository. The Bazel NodeJS rules can link
32+
// these packages into the `node_modules/` folder and this would break the summary file generation.
33+
"node_modules/@angular/cdk/**",
34+
"node_modules/@angular/cdk-experimental/**",
35+
"node_modules/@angular/components-examples/**",
36+
"node_modules/@angular/google-maps/**",
37+
"node_modules/@angular/material/**",
38+
"node_modules/@angular/material-experimental/**",
39+
"node_modules/@angular/material-moment-adapter/**",
40+
"node_modules/@angular/youtube-player/**"
3141
]
3242
}

0 commit comments

Comments
 (0)