Skip to content

Instantly share code, notes, and snippets.

@marekalgoud
Created September 26, 2019 09:54
Show Gist options
  • Save marekalgoud/84adc6f504e078ad1cb4ef574b2c4d09 to your computer and use it in GitHub Desktop.
Save marekalgoud/84adc6f504e078ad1cb4ef574b2c4d09 to your computer and use it in GitHub Desktop.
lazyloading script
import(/* webpackChunkName: "article" */ `./pages/article`).then(module => {
try {
const Article = module.default
const article = new Article()
article.init()
} catch (err) {
console.error(err)
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment