From d016f292e058c61b73f9947c80f7fb8184c79a8c Mon Sep 17 00:00:00 2001 From: Florent Lagrede Date: Tue, 1 Oct 2024 17:38:11 +0200 Subject: [PATCH] fix: make provider import dynamic (#2492) --- web-marketplace/src/clients/Clients.constants.tsx | 7 ++++--- web-marketplace/src/clients/regen/Regen.Providers.tsx | 2 ++ .../src/clients/terrasos/Terrasos.Providers.tsx | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/web-marketplace/src/clients/Clients.constants.tsx b/web-marketplace/src/clients/Clients.constants.tsx index fdffad3b16..71e01419cc 100644 --- a/web-marketplace/src/clients/Clients.constants.tsx +++ b/web-marketplace/src/clients/Clients.constants.tsx @@ -1,8 +1,9 @@ -import { ReactNode } from 'react'; +import { lazy, ReactNode } from 'react'; import { CLIENT_CONFIG, MARKETPLACE_CLIENT_TYPE } from './Clients.types'; -import { RegenProvider } from './regen/Regen.Providers'; -import { TerrasosProvider } from './terrasos/Terrasos.Providers'; + +const RegenProvider = lazy(() => import('./regen/Regen.Providers')); +const TerrasosProvider = lazy(() => import('./terrasos/Terrasos.Providers')); export const PROVIDERS_MAPPING: Record = { regen: , diff --git a/web-marketplace/src/clients/regen/Regen.Providers.tsx b/web-marketplace/src/clients/regen/Regen.Providers.tsx index 86d783a29b..e274d145d7 100644 --- a/web-marketplace/src/clients/regen/Regen.Providers.tsx +++ b/web-marketplace/src/clients/regen/Regen.Providers.tsx @@ -50,3 +50,5 @@ export const RegenProvider = () => { ); }; + +export default RegenProvider; diff --git a/web-marketplace/src/clients/terrasos/Terrasos.Providers.tsx b/web-marketplace/src/clients/terrasos/Terrasos.Providers.tsx index 63208687af..2bda8da96f 100644 --- a/web-marketplace/src/clients/terrasos/Terrasos.Providers.tsx +++ b/web-marketplace/src/clients/terrasos/Terrasos.Providers.tsx @@ -22,3 +22,5 @@ export const TerrasosProvider = () => { ); }; + +export default TerrasosProvider;