From f26206de8703707eb2995c91266042299d17942e Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Thu, 9 Nov 2023 00:45:37 +0100 Subject: [PATCH] Reconfigure Vuetify to be installed as Vuetify doc states As of today, the vutetify doc states how to install it in the nuxt. So following the guide I did it. Now the website layout does not "jump" with offsets on load. --- nuxt.config.ts | 15 ++++++++++++++- plugins/vuetify.ts | 2 -- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/nuxt.config.ts b/nuxt.config.ts index 78ca3e0..37c9e53 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,10 +1,19 @@ import { defineNuxtConfig } from "nuxt/config"; +import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'; + // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ pages: true, build: { transpile: ["vuetify"], }, + modules: [ + (_options, nuxt) => { + nuxt.hooks.hook('vite:extendConfig', (config) => { + config.plugins?.push(vuetify({ autoImport: true })); + }); + }, + ], css: [ "vuetify/lib/styles/main.sass", "@mdi/font/css/materialdesignicons.min.css", @@ -18,7 +27,11 @@ export default defineNuxtConfig({ }, }, vite: { - // devBundler: "legacy" + vue: { + template: { + transformAssetUrls, + }, + }, }, imports: { autoImport: false, diff --git a/plugins/vuetify.ts b/plugins/vuetify.ts index 166e486..97b4e04 100644 --- a/plugins/vuetify.ts +++ b/plugins/vuetify.ts @@ -6,8 +6,6 @@ import { defineNuxtPlugin } from '#app'; export default defineNuxtPlugin((nuxtApp) => { const vuetify = createVuetify({ ssr: true, - components, - directives, theme: { }, });