Skip to content

Commit

Permalink
[Refactor] Preload purchases app js bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
damassi committed May 27, 2020
1 parent be481b6 commit 585c30f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
*/
{
...sharedConfig,
modulePathIgnorePatterns: ["v2", "data"],
modulePathIgnorePatterns: ["v2"],
testRegex: ".*\\.jest\\.(ts|tsx|js|jsx)$",
setupFiles: ["<rootDir>/test.config.js"],
roots: ["<rootDir>/src"],
Expand Down
7 changes: 6 additions & 1 deletion src/v2/Apps/Purchase/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 585c30f

Please sign in to comment.