Skip to content

Commit

Permalink
making loading faster!
Browse files Browse the repository at this point in the history
  • Loading branch information
reZach committed Feb 12, 2021
1 parent a295e9f commit 8ec6a50
Show file tree
Hide file tree
Showing 4 changed files with 11,102 additions and 18,748 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"Redux": "./app/src/redux",
"I18n": "./app/localization"
}
}
},
"@babel/plugin-syntax-dynamic-import"
]
],
"presets": [
Expand Down
29 changes: 23 additions & 6 deletions app/src/core/routes.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,29 @@
import React from "react";
import { Switch, Route } from "react-router";
import ROUTES from "Constants/routes";
import Welcome from "Pages/welcome/welcome";
import About from "Pages/about/about";
import Motd from "Pages/motd/motd";
import Localization from "Pages/localization/localization";
import UndoRedo from "Pages/undoredo/undoredo";
import ContextMenu from "Pages/contextmenu/contextmenu";
import loadable from "@loadable/component";

// Load bundles asynchronously so that the initial render happens faster
const Welcome = loadable(() =>
import(/* webpackChunkName: "WelcomeChunk" */ "Pages/welcome/welcome")
);
const About = loadable(() =>
import(/* webpackChunkName: "AboutChunk" */ "Pages/about/about")
);
const Motd = loadable(() =>
import(/* webpackChunkName: "MotdChunk" */ "Pages/motd/motd")
);
const Localization = loadable(() =>
import(
/* webpackChunkName: "LocalizationChunk" */ "Pages/localization/localization"
)
);
const UndoRedo = loadable(() =>
import(/* webpackChunkName: "UndoRedoChunk" */ "Pages/undoredo/undoredo")
);
const ContextMenu = loadable(() =>
import(/* webpackChunkName: "ContextMenuChunk" */ "Pages/contextmenu/contextmenu")
);

class Routes extends React.Component {
render() {
Expand Down
Loading

0 comments on commit 8ec6a50

Please sign in to comment.