Skip to content

Commit

Permalink
Merge pull request #1825 from oasisprotocol/lw/treeshake-e2e
Browse files Browse the repository at this point in the history
Fix tree-shaking E2E page in production
  • Loading branch information
lukaw3d committed Jan 11, 2024
2 parents c933e1d + e9b0ec9 commit a6cb4f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions .changelog/1825.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix tree-shaking E2E page in production
15 changes: 10 additions & 5 deletions src/commonRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = [
Expand Down Expand Up @@ -71,8 +70,14 @@ export const commonRoutes: RouteObject[] = [
path: 'open-wallet/ledger',
element: <FromLedger />,
},
{
path: 'e2e',
element: process.env.REACT_APP_E2E_TEST ? <E2EPage /> : <div />,
},
]

if (process.env.REACT_APP_E2E_TEST) {
commonRoutes.push({
path: 'e2e',
lazy: async () => {
const { E2EPage } = await import('app/pages/E2EPage')
return { element: <E2EPage /> }
},
})
}

0 comments on commit a6cb4f8

Please sign in to comment.