Skip to content

Commit e5c82df

Browse files
Update packages/nx-plugin/src/plugin/target/executor-target.ts
Co-authored-by: Matěj Chalk <34691111+matejchalk@users.noreply.github.com>
1 parent a4c759b commit e5c82df

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

packages/nx-plugin/src/plugin/target/executor-target.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,10 @@ export function createExecutorTarget(options?: {
88
}): TargetConfiguration<ProjectPrefixOptions> {
99
const { bin, projectPrefix } = options ?? {};
1010

11-
const targetConfig: TargetConfiguration<ProjectPrefixOptions> = {
12-
executor: `${PACKAGE_NAME}:cli`,
11+
const executor = `${PACKAGE_NAME}:cli`;
12+
const options = (bin || projectPrefix) && {
13+
...(bin && { bin }),
14+
...(projectPrefix && { projectPrefix }),
1315
};
14-
15-
if (bin || projectPrefix) {
16-
targetConfig.options = {
17-
...(bin ? { bin } : {}),
18-
...(projectPrefix ? { projectPrefix } : {}),
19-
};
20-
}
21-
22-
return targetConfig;
16+
return { executor, ...(options && { options })};
2317
}

0 commit comments

Comments
 (0)