Have you implemented vuetify-loader alongside tree-shaking? If yes, you can simply import a specific Vuetify component into a particular .vue
file:
import { VTextField } from 'vuetify/lib';
and then include it like this:
components: { VTextField }
As per the documentation of the @nuxtjs/vuetify module, when using the treeShake
option, your Nuxt.js app will only use necessary vuetify components by default, without increasing the bundle size.
Utilize vuetify-loader to activate automatic tree-shaking. By default, enabled only for production environments.
Additionally, if you are working with Nuxt >= 2.9.0
, make sure to use the buildModules section instead:
{
buildModules: [
// Simple implementation
'@nuxtjs/vuetify',
// With customization options
['@nuxtjs/vuetify', { /* module options */ }]
]
}