G
G
grabbee2020-09-05 22:12:57
webpack
grabbee, 2020-09-05 22:12:57

Will dynamic import improve VUE site loading or not?

There, components can be imported in at least two ways

import StaticComponent from '@/components/StaticComponent';
 
export default {
  components: {
    DynamicComponent: () => import('@npm-vendor/DynamicComponent'),
    StaticComponent,
  },
}


All pages are the same. Components are very often reused. For example the pagination widget. Or some kind of menu. There are a lot of pages

If I make most of the components dynamic loading, will it speed up the site? After all, each such piece will be taken by a separate request.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aetae, 2020-09-06
@Aetae

Will beat. Should be used wisely. Basically, when such components pull decent (in size relative to the bundle) pieces of code with them, but are rarely called.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question