diff --git a/.changelog/1825.internal.md b/.changelog/1825.internal.md new file mode 100644 index 0000000000..3055ec9553 --- /dev/null +++ b/.changelog/1825.internal.md @@ -0,0 +1 @@ +Fix tree-shaking E2E page in production diff --git a/src/commonRoutes.tsx b/src/commonRoutes.tsx index 30a343ab7f..fdf245fd13 100644 --- a/src/commonRoutes.tsx +++ b/src/commonRoutes.tsx @@ -13,7 +13,6 @@ import { ActiveDelegationList } from 'app/pages/StakingPage/Features/DelegationL import { DebondingDelegationList } from 'app/pages/StakingPage/Features/DelegationList/DebondingDelegationList' import { ParaTimes } from 'app/pages/ParaTimesPage' import { FiatOnramp } from 'app/pages/FiatOnrampPage' -import { E2EPage } from 'app/pages/E2EPage' import { ErrorBoundary } from 'app/components/ErrorBoundary' export const commonRoutes: RouteObject[] = [ @@ -71,8 +70,14 @@ export const commonRoutes: RouteObject[] = [ path: 'open-wallet/ledger', element: , }, - { - path: 'e2e', - element: process.env.REACT_APP_E2E_TEST ? :
, - }, ] + +if (process.env.REACT_APP_E2E_TEST) { + commonRoutes.push({ + path: 'e2e', + lazy: async () => { + const { E2EPage } = await import('app/pages/E2EPage') + return { element: } + }, + }) +}