R
R
reinmaker902021-01-15 21:51:39
Vue.js
reinmaker90, 2021-01-15 21:51:39

How to take only used components into the project?

There is a project that uses bootstrapvue components (3-5 pcs), is it possible somehow during assembly or is there a way for a similar framework or bulma, element.io, etc., when using them in a project, only pull out what components will we use?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2021-01-15
@reinmaker1990

Depending on how you connect these components. The assembler includes what you include.
If you globally connect all components at once, so as not to import them many times, ala

import Vue from 'vue'
import Vuetify from 'vuetify'

Vue.use(Vuetify)

Then it is logical that everything will fall into your bundle. There is no special plugin here.
And if "locally" in your components you connect only the necessary ala
import {VToolbar} from 'vuetify/lib'
export default defineComponent({
  components: {VToolbar}
})

Then the final bundle will contain only what was connected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question