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.
This commit is contained in:
Wroclaw 2023-11-09 00:45:37 +01:00
parent aa645e710e
commit f26206de87
2 changed files with 14 additions and 3 deletions

View file

@ -1,10 +1,19 @@
import { defineNuxtConfig } from "nuxt/config"; import { defineNuxtConfig } from "nuxt/config";
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
pages: true, pages: true,
build: { build: {
transpile: ["vuetify"], transpile: ["vuetify"],
}, },
modules: [
(_options, nuxt) => {
nuxt.hooks.hook('vite:extendConfig', (config) => {
config.plugins?.push(vuetify({ autoImport: true }));
});
},
],
css: [ css: [
"vuetify/lib/styles/main.sass", "vuetify/lib/styles/main.sass",
"@mdi/font/css/materialdesignicons.min.css", "@mdi/font/css/materialdesignicons.min.css",
@ -18,7 +27,11 @@ export default defineNuxtConfig({
}, },
}, },
vite: { vite: {
// devBundler: "legacy" vue: {
template: {
transformAssetUrls,
},
},
}, },
imports: { imports: {
autoImport: false, autoImport: false,

View file

@ -6,8 +6,6 @@ import { defineNuxtPlugin } from '#app';
export default defineNuxtPlugin((nuxtApp) => { export default defineNuxtPlugin((nuxtApp) => {
const vuetify = createVuetify({ const vuetify = createVuetify({
ssr: true, ssr: true,
components,
directives,
theme: { theme: {
}, },
}); });