Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vuetify js Optimization with Nuxt JS

Tags:

We are using Nuxtjs 2.3.4 and VuetifyJS 1.2.10.

There is a lot of unused CSS and js from VuetifyJs on each and every page.

How can I remove unwanted css/js of VuetifyJs from each page??

Can anyone help!!

like image 344
Hardik Shah Avatar asked Mar 18 '19 07:03

Hardik Shah


1 Answers

You can use vuetify loader for this

In your nuxt.config.js

    import VuetifyLoaderPlugin from 'vuetify-loader/lib/plugin' 
    ...

    build: {
      transpile: ['vuetify/lib'],
      plugins: [new VuetifyLoaderPlugin()],

in plugins

import Vuetify from 'vuetify/lib'
Vue.use(Vuetify)

Or you can just use nuxt-vuetify module with treeshake option

like image 96
Aldarund Avatar answered Oct 04 '22 02:10

Aldarund