do not use @nuxtjs/vuetify module, manually preload vuetify via plugin

This commit is contained in:
lesion 2021-10-29 13:13:44 +02:00
parent 5ec01cc3f2
commit df4bc563a6
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 44 additions and 28 deletions

View file

@ -24,8 +24,9 @@ module.exports = {
** Global CSS
*/
css: [
'@/assets/style.less',
'@mdi/font/css/materialdesignicons.css'
'vuetify/dist/vuetify.min.css',
'@mdi/font/css/materialdesignicons.css',
'@/assets/style.less'
],
/*
@ -34,21 +35,13 @@ module.exports = {
plugins: [
'@/plugins/i18n.js',
'@/plugins/filters', // text filters, datetime filters, generic transformation helpers etc.
'@/plugins/vue-clipboard', // vuetify
'@/plugins/vuetify', // vuetify
'@/plugins/axios', // axios baseurl configuration
'@/plugins/validators', // inject validators
'@/plugins/api', // api helpers
{ src: '@/plugins/v-calendar', ssr: false } // v-calendar
],
render: {
compressor: false,
bundleRenderer: {
shouldPreload: (file, type) => {
return ['script', 'style', 'font'].includes(type)
}
}
},
/*
** Nuxt.js modules
*/
@ -94,16 +87,9 @@ module.exports = {
}
}
},
buildModules: [
'nuxt-build-optimisations',
'@nuxtjs/vuetify',
// ['nuxt-express-module', { expressPath: 'server/', routesPath: 'server/routes' }],
],
vuetify: {
defaultAssets: false,
optionsPath: './vuetify.options.js',
treeShake: true
/* module options */
build: {
corejs: 3,
cache: true,
hardSource: true
},
}

View file

@ -1,6 +0,0 @@
import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
export default () => {
Vue.use(VueClipboard)
}

36
plugins/vuetify.js Normal file
View file

@ -0,0 +1,36 @@
import Vue from 'vue'
import VueClipboard from 'vue-clipboard2'
import Vuetify from 'vuetify'
// import it from 'vuetify/lib/locale/it.js'
// import en from 'vuetify/lib/locale/en.js'
// import es from 'vuetify/lib/locale/es'
// import no from 'vuetify/lib/locale/no'
// import fr from 'vuetify/lib/locale/fr'
// import ca from 'vuetify/lib/locale/ca'
export default ({ app }) => {
Vue.use(Vuetify)
Vue.use(VueClipboard)
app.vuetify = new Vuetify({
// lang: {
// locales: { en, it }, //, es, fr, no, ca },
// current: 'en'
// },
icons: {
iconfont: 'mdi'
},
theme: {
dark: true,
themes: {
dark: {
primary: '#FF6E40'
},
light: {
primary: '#FF4500'
}
}
}
})
}