build: Add async chunk names (#2170)

This commit is contained in:
Viorel Cojocaru
2021-06-04 07:01:23 +02:00
committed by GitHub
parent 1f49b35c89
commit 082ced3072
7 changed files with 34 additions and 11 deletions

View File

@@ -20,7 +20,9 @@ import Route from "components/ProfiledRoute";
import SocketProvider from "components/SocketProvider";
import { matchDocumentSlug as slug } from "utils/routeHelpers";
const SettingsRoutes = React.lazy(() => import("./settings"));
const SettingsRoutes = React.lazy(() =>
import(/* webpackChunkName: "settings" */ "./settings")
);
const NotFound = () => <Search notFound />;
const RedirectDocument = ({ match }: { match: Match }) => (

View File

@@ -6,11 +6,23 @@ import FullscreenLoading from "components/FullscreenLoading";
import Route from "components/ProfiledRoute";
import { matchDocumentSlug as slug } from "utils/routeHelpers";
const Authenticated = React.lazy(() => import("components/Authenticated"));
const AuthenticatedRoutes = React.lazy(() => import("./authenticated"));
const KeyedDocument = React.lazy(() => import("scenes/Document/KeyedDocument"));
const Login = React.lazy(() => import("scenes/Login"));
const Logout = React.lazy(() => import("scenes/Logout"));
const Authenticated = React.lazy(() =>
import(/* webpackChunkName: "authenticated" */ "components/Authenticated")
);
const AuthenticatedRoutes = React.lazy(() =>
import(/* webpackChunkName: "authenticated-routes" */ "./authenticated")
);
const KeyedDocument = React.lazy(() =>
import(
/* webpackChunkName: "keyed-document" */ "scenes/Document/KeyedDocument"
)
);
const Login = React.lazy(() =>
import(/* webpackChunkName: "login" */ "scenes/Login")
);
const Logout = React.lazy(() =>
import(/* webpackChunkName: "logout" */ "scenes/Logout")
);
export default function Routes() {
return (