From df4bc563a6dff8df7addcac3c58afb99e160728f Mon Sep 17 00:00:00 2001 From: lesion Date: Fri, 29 Oct 2021 13:13:44 +0200 Subject: [PATCH] do not use @nuxtjs/vuetify module, manually preload vuetify via plugin --- nuxt.config.js | 30 ++++++++---------------------- plugins/vue-clipboard.js | 6 ------ plugins/vuetify.js | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+), 28 deletions(-) delete mode 100644 plugins/vue-clipboard.js create mode 100644 plugins/vuetify.js diff --git a/nuxt.config.js b/nuxt.config.js index 9aea0fcc..fc249054 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -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 }, - } diff --git a/plugins/vue-clipboard.js b/plugins/vue-clipboard.js deleted file mode 100644 index 6aa43863..00000000 --- a/plugins/vue-clipboard.js +++ /dev/null @@ -1,6 +0,0 @@ -import Vue from 'vue' -import VueClipboard from 'vue-clipboard2' - -export default () => { - Vue.use(VueClipboard) -} diff --git a/plugins/vuetify.js b/plugins/vuetify.js new file mode 100644 index 00000000..69f2d9d5 --- /dev/null +++ b/plugins/vuetify.js @@ -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' + } + } + } + }) +} \ No newline at end of file