Skip to content

Commit 259e269

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular/cli): merge npmrc files values
Closes #21406
1 parent 24b1062 commit 259e269

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/angular/cli/utilities/package-metadata.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function readOptions(
143143
// See: https://github.com/npm/npm-registry-fetch/blob/ebddbe78a5f67118c1f7af2e02c8a22bcaf9e850/index.js#L99-L126
144144
const rcConfig: PackageManagerOptions = yarn ? lockfile.parse(data) : ini.parse(data);
145145

146-
rcOptions = normalizeOptions(rcConfig, location);
146+
rcOptions = normalizeOptions(rcConfig, location, rcOptions);
147147
}
148148
}
149149

@@ -166,17 +166,15 @@ function readOptions(
166166
envVariablesOptions[normalizedName] = value;
167167
}
168168

169-
return {
170-
...rcOptions,
171-
...normalizeOptions(envVariablesOptions),
172-
};
169+
return normalizeOptions(envVariablesOptions, undefined, rcOptions);
173170
}
174171

175172
function normalizeOptions(
176173
rawOptions: PackageManagerOptions,
177174
location = process.cwd(),
175+
existingNormalizedOptions: PackageManagerOptions = {},
178176
): PackageManagerOptions {
179-
const options: PackageManagerOptions = {};
177+
const options = { ...existingNormalizedOptions };
180178

181179
for (const [key, value] of Object.entries(rawOptions)) {
182180
let substitutedValue = value;

0 commit comments

Comments
 (0)