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,
|
updateJson,
|
||||||
convertNxGenerator,
|
convertNxGenerator,
|
||||||
generateFiles,
|
generateFiles,
|
||||||
joinPathFragments,
|
|
||||||
logger,
|
logger,
|
||||||
offsetFromRoot,
|
offsetFromRoot,
|
||||||
readProjectConfiguration,
|
readProjectConfiguration,
|
||||||
@ -100,12 +99,18 @@ export async function customServerGenerator(
|
|||||||
updateProjectConfiguration(host, options.project, project);
|
updateProjectConfiguration(host, options.project, project);
|
||||||
|
|
||||||
updateJson(host, 'nx.json', (json) => {
|
updateJson(host, 'nx.json', (json) => {
|
||||||
|
if (
|
||||||
|
!json.tasksRunnerOptions?.default?.options?.cacheableOperations?.includes(
|
||||||
|
'build-custom-server'
|
||||||
|
)
|
||||||
|
) {
|
||||||
json.tasksRunnerOptions ??= {};
|
json.tasksRunnerOptions ??= {};
|
||||||
json.tasksRunnerOptions.default ??= { options: {} };
|
json.tasksRunnerOptions.default ??= { options: {} };
|
||||||
json.tasksRunnerOptions.default.options.cacheableOperations = [
|
json.tasksRunnerOptions.default.options.cacheableOperations = [
|
||||||
...json.tasksRunnerOptions.default.options.cacheableOperations,
|
...json.tasksRunnerOptions.default.options.cacheableOperations,
|
||||||
'build-custom-server',
|
'build-custom-server',
|
||||||
];
|
];
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user