From 57ac262851de1d58d3336bc9691ffad6d8b6b6fc Mon Sep 17 00:00:00 2001 From: Arya Khochare Date: Wed, 28 Jan 2026 02:23:45 +0530 Subject: [PATCH 1/2] remove SSR related configuration --- src/config/config.server.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/config/config.server.ts b/src/config/config.server.ts index b0a71e96985..571d75a78a5 100644 --- a/src/config/config.server.ts +++ b/src/config/config.server.ts @@ -169,6 +169,16 @@ const buildBaseUrl = (config: ServerConfig): void => { ].join(''); }; +const removeServerSideConfig = (config: AppConfig): any => { + const clientConfig = JSON.parse(JSON.stringify(config)); + delete clientConfig.rest.ssrBaseUrl; + delete clientConfig.rest.hasSsrBaseUrl; + delete clientConfig.cache.serverSide; + delete clientConfig.ui.rateLimiter; + delete clientConfig.ui.useProxies; + return clientConfig; +}; + /** * Build app config with the following chain of override. * @@ -247,7 +257,8 @@ export const buildAppConfig = (destConfigPath?: string): AppConfig => { buildBaseUrl(appConfig.rest); if (isNotEmpty(destConfigPath)) { - writeFileSync(destConfigPath, JSON.stringify(appConfig, null, 2)); + const clientConfig = removeServerSideConfig(appConfig); + writeFileSync(destConfigPath, JSON.stringify(clientConfig, null, 2)); console.log(`Angular ${bold('config.json')} file generated correctly at ${bold(destConfigPath)} \n`); } From c8dd3bbbf649796c2a185e9a1fecee64cb6482b0 Mon Sep 17 00:00:00 2001 From: Arya Khochare Date: Wed, 28 Jan 2026 22:20:13 +0530 Subject: [PATCH 2/2] added comment --- src/config/config.server.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/config/config.server.ts b/src/config/config.server.ts index 571d75a78a5..4518a77c6eb 100644 --- a/src/config/config.server.ts +++ b/src/config/config.server.ts @@ -169,6 +169,13 @@ const buildBaseUrl = (config: ServerConfig): void => { ].join(''); }; +/** + * Removes all server-side specific settings from the application configuration. + * This method is used to ensure the "assets/config.json" that provides runtime + * configuration to CSR (client side rendering) excludes these server-side keys. + * + * @param config the application configuration + */ const removeServerSideConfig = (config: AppConfig): any => { const clientConfig = JSON.parse(JSON.stringify(config)); delete clientConfig.rest.ssrBaseUrl;