Question:
I’m currently working on a Laravel 9 project with Vite and I’m trying to integrate Vuetify into it. I’ve followed the instructions on the Vuetify documentation, but the styles are not being applied
app.js
import App from "./App.vue";
// Vuetify
import "vuetify/styles";
import { createVuetify } from "vuetify";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";
const vuetify = createVuetify({
components,
directives,
});
createApp(App).use(vuetify).mount("#app");
vite.config.js
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import vue from "@vitejs/plugin-vue";
export default defineConfig({
plugins: [vue(), laravel(["resources/css/app.css", "resources/js/app.js"])],
});
plugins/vuetify.js
import "@mdi/font/css/materialdesignicons.css";
import "vuetify/styles";
const vuetify = createVuetify({
ssr: true,
});
2
Answers
I found a solution, edit app.js and add lines
Do you have your JS and CSS files integrated in your view?
In the head tag put the following line:
Now the vite will be implemented in your view and styles should apply!