From 585c30feae2119b11a419e8595b2d30e97190753 Mon Sep 17 00:00:00 2001 From: Christopher Pappas Date: Tue, 26 May 2020 22:13:15 -0700 Subject: [PATCH] [Refactor] Preload purchases app js bundle --- jest.config.js | 2 +- src/v2/Apps/Purchase/routes.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/jest.config.js b/jest.config.js index d065850c827..6f7bdef2d3d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -19,7 +19,7 @@ module.exports = { */ { ...sharedConfig, - modulePathIgnorePatterns: ["v2", "data"], + modulePathIgnorePatterns: ["v2"], testRegex: ".*\\.jest\\.(ts|tsx|js|jsx)$", setupFiles: ["/test.config.js"], roots: ["/src"], diff --git a/src/v2/Apps/Purchase/routes.tsx b/src/v2/Apps/Purchase/routes.tsx index d400b436f1b..b568de3130f 100644 --- a/src/v2/Apps/Purchase/routes.tsx +++ b/src/v2/Apps/Purchase/routes.tsx @@ -2,10 +2,15 @@ import loadable from "@loadable/component" import { graphql } from "react-relay" import { RouteConfig } from "found" +const PurchasesApp = loadable(() => import("./PurchaseApp")) + export const routes: RouteConfig[] = [ { path: "/user/purchases", - getComponent: () => loadable(() => import("./PurchaseApp")), + getComponent: () => PurchasesApp, + prepare: () => { + PurchasesApp.preload() + }, query: graphql` query routes_PurchaseQuery { me {