Created
January 21, 2019 19:31
-
-
Save iampava/8b31a1c71ef110ec9522a2e9453f8868 to your computer and use it in GitHub Desktop.
#1 JavaScript: fast and furious
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Loadable from 'react-loadable'; | |
// Landing page | |
const LazyLandingPage = Loadable({ | |
loader: () => import('./landing/Landing.page'), | |
modules: ['./landing/Landing.page'], | |
webpack: () => [require.resolveWeak('./landing/Landing.page')] | |
}); | |
const LazyLanding = props => <LazyLandingPage {...props} />; | |
// Home page | |
const LazyHomePage = Loadable({ | |
loader: () => import('./home/Home.page'), | |
modules: ['./home/Home.page'], | |
webpack: () => [require.resolveWeak('./home/Home.page')] | |
}); | |
const LazyHome = props => <LazyHomePage {...props} />; | |
export { | |
LazyLanding, | |
LazyHome | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment