Created
August 21, 2021 19:15
-
-
Save charisTheo/4336b1d865bb921f02aaed690e3321fc to your computer and use it in GitHub Desktop.
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
| const LoadablePlugin = require('@loadable/webpack-plugin') | |
| exports.onCreateWebpackConfig = ({ actions, plugins }) => { | |
| actions.setWebpackConfig({ | |
| plugins: [new LoadablePlugin()] | |
| }) | |
| } | |
| import loadable from '@loadable/component' | |
| export default function Page(props) { | |
| const LazyComponent = loadable(() => import(`../components/lazyComponent.js`)) | |
| return ( | |
| <Layout> | |
| // ... | |
| <LazyComponent whatAmI={"Lazy!"} /> | |
| </Layout> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment