fix(nextjs): Ensure build-custom-server is only added once to nx.json (#18972)
This commit is contained in:
parent
f3f12d4201
commit
b42be17e52
@ -3,7 +3,6 @@ import {
|
||||
updateJson,
|
||||
convertNxGenerator,
|
||||
generateFiles,
|
||||
joinPathFragments,
|
||||
logger,
|
||||
offsetFromRoot,
|
||||
readProjectConfiguration,
|
||||
@ -100,12 +99,18 @@ export async function customServerGenerator(
|
||||
updateProjectConfiguration(host, options.project, project);
|
||||
|
||||
updateJson(host, 'nx.json', (json) => {
|
||||
if (
|
||||
!json.tasksRunnerOptions?.default?.options?.cacheableOperations?.includes(
|
||||
'build-custom-server'
|
||||
)
|
||||
) {
|
||||
json.tasksRunnerOptions ??= {};
|
||||
json.tasksRunnerOptions.default ??= { options: {} };
|
||||
json.tasksRunnerOptions.default.options.cacheableOperations = [
|
||||
...json.tasksRunnerOptions.default.options.cacheableOperations,
|
||||
'build-custom-server',
|
||||
];
|
||||
}
|
||||
return json;
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user