fix(core): handle project graph plugins not providing optional projectFilePatterns property (#8290)
This commit is contained in:
parent
419948015e
commit
d3f4613687
@ -64,17 +64,19 @@ export function mergePluginTargetsWithNxTargets(
|
|||||||
): Record<string, TargetConfiguration> {
|
): Record<string, TargetConfiguration> {
|
||||||
let newTargets: Record<string, TargetConfiguration> = {};
|
let newTargets: Record<string, TargetConfiguration> = {};
|
||||||
for (const plugin of plugins) {
|
for (const plugin of plugins) {
|
||||||
|
if (!plugin.projectFilePatterns?.length || !plugin.registerProjectTargets) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const projectFiles = sync(`+(${plugin.projectFilePatterns.join('|')})`, {
|
const projectFiles = sync(`+(${plugin.projectFilePatterns.join('|')})`, {
|
||||||
cwd: join(appRootPath, projectRoot),
|
cwd: join(appRootPath, projectRoot),
|
||||||
});
|
});
|
||||||
for (const projectFile of projectFiles) {
|
for (const projectFile of projectFiles) {
|
||||||
if (plugin.registerProjectTargets) {
|
|
||||||
newTargets = {
|
newTargets = {
|
||||||
...newTargets,
|
...newTargets,
|
||||||
...plugin.registerProjectTargets(join(projectRoot, projectFile)),
|
...plugin.registerProjectTargets(join(projectRoot, projectFile)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return { ...newTargets, ...targets };
|
return { ...newTargets, ...targets };
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user