Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(routing): make all routes non lazy
Browse files Browse the repository at this point in the history
fix(routing): make all routes non lazy
  • Loading branch information
Metnew committed Feb 19, 2018
1 parent de7e52a commit 06528b6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/common/routing/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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[] = [
Expand All @@ -60,7 +58,7 @@ function routingFnCreator (useFor) {
name: 'Links'
},
{
component: AsyncNotFound,
component: NotFound,
name: '404'
}
]
Expand Down

0 comments on commit 06528b6

Please sign in to comment.