fix(core): repair sourcemap creation in createNodes (#22851)

This commit is contained in:
MaxKless 2024-04-17 15:03:16 +02:00 committed by GitHub
parent 801a22b243
commit e05cb4f689
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ export function selectSourceInfo(
// When the key is a prefix of the filter, we can record it as the root source. // When the key is a prefix of the filter, we can record it as the root source.
// Use the most specific key for the root "." source value. // Use the most specific key for the root "." source value.
// e.g. `targets.build` takes precedence over `targets` // e.g. `targets.build` takes precedence over `targets`
if (!rootKey || key.startsWith(rootKey)) { if (!rootKey || key?.startsWith(rootKey)) {
rootKey = key; rootKey = key;
rootSource = value; rootSource = value;
} }

View File

@ -20,7 +20,7 @@ export function SourcemapInfoToolTip({
// Every other property within in the target has the form `target.${targetName}.${propertyName} // Every other property within in the target has the form `target.${targetName}.${propertyName}
const isTarget = propertyKey.split('.').length === 2; const isTarget = propertyKey.split('.').length === 2;
const docsUrlSlug: string | undefined = plugin.startsWith('@nx/') const docsUrlSlug: string | undefined = plugin?.startsWith('@nx/')
? plugin.replace('@nx/', '').split('/')[0] ? plugin.replace('@nx/', '').split('/')[0]
: undefined; : undefined;

View File

@ -89,7 +89,7 @@ export async function runCreateNodesInParallel(
// Existing behavior is to ignore null results of // Existing behavior is to ignore null results of
// createNodes function. // createNodes function.
if (r) { if (r) {
results.push(r); results.push({ ...r, file, pluginName: plugin.name });
} }
}); });
}); });