user947668
user947668

Reputation: 2728

Vue reusable component and Nuxt app bundle size

I would like to clarify results of webpack bundle analyzer for my NUXT project.

CitySelector component is being used multiple times on different nuxt pages. Basic import:

import CitySelector from "~/components/CitySelector.vue"

export default {
  components: {
      CitySelector
  },

After checking webpack bundle analyzer results I see multiple blocks with CitySelector:

enter image description here

I guess bundle size is too big because of wrong use of reusable component. Please advise whether my interpretation of the analyzer results is right? Can bundle size be optimized in such case?

Upvotes: 1

Views: 719

Answers (1)

Aldarund
Aldarund

Reputation: 17621

You should use Nuxt 2.4 and it will be handled automatically and there won't be repeated pieces of code like on screenshot

Upvotes: 3

Related Questions