Home

Issue: 3116

How to lazy load components?

[issue link]

Hello. I have admin route where I have big Component that uses few external libraries. This route will be avaliable only for me, not for users of my site. RIght now it’s loaded from the start even if I on another route.

I tried this

const vue2Dropzone = () => import('vue2-dropzone')
components: {
    vueDropzone: vue2Dropzone
  }

But still chunk is loaded even if I am not on this route. What is the logic behinfd this? How to actually load code only when I need it? Why it is not working out of the box?

This question is available on Nuxt.js community (#c2698)