From 06528b679c3c5f78a05cd8b71480b4353ccc6887 Mon Sep 17 00:00:00 2001 From: Vladimir Metnev Date: Mon, 19 Feb 2018 08:03:44 +0200 Subject: [PATCH] fix(routing): make all routes non lazy fix(routing): make all routes non lazy --- src/common/routing/index.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common/routing/index.jsx b/src/common/routing/index.jsx index 7c58906f..edcd04bd 100644 --- a/src/common/routing/index.jsx +++ b/src/common/routing/index.jsx @@ -6,15 +6,13 @@ import {Loader, Dimmer, Header, Icon} from 'semantic-ui-react' import _ from 'lodash' import Dashboard from 'containers/Dashboard' import Links from 'containers/Links' +import NotFound from 'containers/NotFound' function asyncComponentCreator (url) { return asyncComponent({ resolve: () => { - if (process.env.BROWSER) { - return require(`containers/${url}/index.jsx`).default - } // flow-disable-next-line: The parameter passed to import() must be a literal string - return import(/* webpackChunkName:"[index].[request]" */ `containers/${url}/index.jsx`) + return import(/* webpackChunkName:"[index].[request]" */ `containers/${url}/index.jsx`) }, LoadingComponent () { return ( @@ -43,7 +41,7 @@ function asyncComponentCreator (url) { } function routingFnCreator (useFor) { - const [AsyncNotFound] = ['NotFound'].map(asyncComponentCreator) + // const AsyncNotFound = asyncComponentCreator('NotFound') // Dashboard and Links included in build // NotFound(404) is lazy const routes: any[] = [ @@ -60,7 +58,7 @@ function routingFnCreator (useFor) { name: 'Links' }, { - component: AsyncNotFound, + component: NotFound, name: '404' } ]