fix(angular): warn in ng-packagr executors when finding conflicting package export conditions (#16905)
This commit is contained in:
parent
6aac7ba04b
commit
bdfb10db0a
@ -397,20 +397,15 @@ function generatePackageExports(
|
||||
subpath: string,
|
||||
mapping: ConditionalExport
|
||||
) => {
|
||||
if (exports[subpath] === undefined) {
|
||||
exports[subpath] = {};
|
||||
}
|
||||
|
||||
exports[subpath] ??= {};
|
||||
const subpathExport = exports[subpath];
|
||||
|
||||
// Go through all conditions that should be inserted. If the condition is already
|
||||
// manually set of the subpath export, we throw an error. In general, we allow for
|
||||
// additional conditions to be set. These will always precede the generated ones.
|
||||
for (const conditionName of Object.keys(mapping) as [
|
||||
keyof ConditionalExport
|
||||
]) {
|
||||
for (const conditionName of Object.keys(mapping)) {
|
||||
if (subpathExport[conditionName] !== undefined) {
|
||||
throw Error(
|
||||
logger.warn(
|
||||
`Found a conflicting export condition for "${subpath}". The "${conditionName}" ` +
|
||||
`condition would be overridden by ng-packagr. Please unset it.`
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user