Skip to content

Commit

Permalink
use named import in lazy load
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewHEguardian committed Jan 24, 2025
1 parent f8f42d3 commit c89eabe
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
2 changes: 0 additions & 2 deletions support-frontend/assets/pages/[countryGroupId]/checkout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,3 @@ export function Checkout({ geoId, appConfig, abParticipations }: Props) {
</Elements>
);
}

export default Checkout;
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,3 @@ export function GuardianAdLiteLanding({
</LandingPageLayout>
);
}

export default GuardianAdLiteLanding;
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,3 @@ export function OneTimeCheckout({
</Elements>
);
}

export default OneTimeCheckout;
39 changes: 24 additions & 15 deletions support-frontend/assets/pages/[countryGroupId]/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,30 @@ const abParticipations = getAbParticipations();
setUpTrackingAndConsents(abParticipations);
const appConfig = parseAppConfig(window.guardian);

const Checkout = lazy(
() => import(/* webpackChunkName: "checkout" */ './checkout'),
);
const OneTimeCheckout = lazy(
() => import(/* webpackChunkName: "oneTimeCheckout" */ './oneTimeCheckout'),
);
const ThankYou = lazy(
() => import(/* webpackChunkName: "ThankYou" */ './thankYou'),
);
const GuardianAdLiteLanding = lazy(
() =>
import(
/* webpackChunkName: "GuardianAdLiteLanding" */ './guardianAdLiteLanding/guardianAdLiteLanding'
),
);
const Checkout = lazy(() => {
return import(/* webpackChunkName: "checkout" */ './checkout').then((mod) => {
return { default: mod.Checkout };
});
});
const OneTimeCheckout = lazy(() => {
return import(
/* webpackChunkName: "oneTimeCheckout" */ './oneTimeCheckout'
).then((mod) => {
return { default: mod.OneTimeCheckout };
});
});
const ThankYou = lazy(() => {
return import(/* webpackChunkName: "ThankYou" */ './thankYou').then((mod) => {
return { default: mod.ThankYou };
});
});
const GuardianAdLiteLanding = lazy(() => {
return import(
/* webpackChunkName: "GuardianAdLiteLanding" */ './guardianAdLiteLanding/guardianAdLiteLanding'
).then((mod) => {
return { default: mod.GuardianAdLiteLanding };
});
});

const router = createBrowserRouter(
geoIds.flatMap((geoId) => [
Expand Down
2 changes: 0 additions & 2 deletions support-frontend/assets/pages/[countryGroupId]/thankYou.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,3 @@ export function ThankYou({
/>
);
}

export default ThankYou;

0 comments on commit c89eabe

Please sign in to comment.