]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix issue with loading localization module 64667/head
authorAfreen Misbah <afreen@ibm.com>
Thu, 24 Jul 2025 11:29:10 +0000 (16:59 +0530)
committerAfreen Misbah <afreen@ibm.com>
Thu, 24 Jul 2025 11:32:12 +0000 (17:02 +0530)
- this module is only required to be imported from polyfill
-  nx now loading this module as well breaking CI tests and dashboard `@angular/localize`

Signed-off-by: Afreen Misbah <afreen@ibm.com>
src/pybind/mgr/dashboard/frontend/module-federation.config.ts

index 8ef89a4865235e8999c55ca463bebc703350d9fc..4c131fffae800538a2e083d59ad6be49205e1fc1 100644 (file)
@@ -2,23 +2,13 @@ import { ModuleFederationConfig } from '@nx/module-federation';
 
 const config: ModuleFederationConfig = {
   name: 'ceph-dashboard',
-  /**
-   * To use a remote that does not exist in your current Nx Workspace
-   * You can use the tuple-syntax to define your remote
-   *
-   * remotes: [['my-external-remote', 'https://nx-angular-remote.netlify.app']]
-   *
-   * You _may_ need to add a `remotes.d.ts` file to your `src/` folder declaring the external remote for tsc, with the
-   * following content:
-   *
-   * declare module 'my-external-remote';
-   *
-   */
-  remotes: []
+  remotes: [],
+  shared: (libraryName, sharedConfig) => {
+    if (libraryName === '@angular/localize' || libraryName === '@angular/localize/init') {
+      return false; // do not share these, import directly via polyfills
+    }
+    return sharedConfig;
+  },
 };
 
-/**
- * Nx requires a default export of the config to allow correct resolution of the module federation graph.
- **/
 export default config;
-