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

Commit

Permalink
fix: use only plain dynamic imports with no comments
Browse files Browse the repository at this point in the history
fix: use only plain dynamic imports with no comments
  • Loading branch information
Metnew committed Nov 4, 2017
1 parent cce4088 commit b09e40c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/common/routing/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,8 @@ import _ from 'lodash'
import type {RouteItem} from 'types'

function asyncComponentCreator (url) {
const importCreator = (name: string) => {
// Read Webpack docs about code-splitting for more info.
if (process.env.BROWSER) {
return import(/* webpackMode: "lazy", webpackChunkName: "[request].lazy" */ `containers/${name}/index.jsx`)
}
return import(/* webpackMode: "eager" */ `containers/${name}/index.jsx`)
}

return asyncComponent({
resolve: () => importCreator(url),
resolve: () => import(`containers/${url}/index.jsx`),
LoadingComponent () {
return (
<Dimmer active>
Expand Down

0 comments on commit b09e40c

Please sign in to comment.