NuxtN
Nuxt2y ago
1 reply
ok3n

Lazy loading components outside of /components

Hello!
I know we can prepend "Lazy" to a component name to lazy load it.
But would it work if the component is explicitely imported from somewhere else than /components? Like this:

from
import Banner from '@/components/Banner/Banner.vue'
to
import LazyBanner from '@/components/Banner/Banner.vue'

or even from a vue component library ?

from
import Button from '@library/Button.vue'
to
import LazyButton from '@library/Button.vue'

would this work?
Was this page helpful?