Skip to content

Instantly share code, notes, and snippets.

@didierfranc
Last active March 18, 2018 21:22
Show Gist options
  • Save didierfranc/0fe06c044612eabb332e91627be8e31e to your computer and use it in GitHub Desktop.
Save didierfranc/0fe06c044612eabb332e91627be8e31e to your computer and use it in GitHub Desktop.
// import() makes your old es6 import async
// it simply return a ... Promise 😻
import MyComponent from './MyComponent'
import('./MyComponent').then(MyComponent => ...)
// You can name your chunks if you want 😘
import(/* webpackChunkName: "my-component" */ './MyComponent')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment