diff --git a/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts b/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts index 02d56adee6337..2bdf3dd1682bd 100644 --- a/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts +++ b/packages/angular/src/generators/setup-ssr/lib/update-project-config.ts @@ -108,16 +108,14 @@ export function updateProjectConfigForBrowserBuilder( const nxJson = readNxJson(tree); if ( - nxJson.tasksRunnerOptions?.default && + nxJson.tasksRunnerOptions?.default?.options?.cacheableOperations && !nxJson.tasksRunnerOptions.default.options.cacheableOperations.includes( 'server' ) ) { - nxJson.tasksRunnerOptions.default.options.cacheableOperations = [ - ...nxJson.tasksRunnerOptions.default.options.cacheableOperations, - 'server', - ]; - updateNxJson(tree, nxJson); + nxJson.tasksRunnerOptions.default.options.cacheableOperations.push( + 'server' + ); } nxJson.targetDefaults ??= {}; nxJson.targetDefaults.server ??= {};