ejaz's avatar
Level 1

Laravel Assets bundling with vite

here is my vite config file

import { defineConfig } from "vite"; import laravel from "laravel-vite-plugin"; import vue from "@vitejs/plugin-vue";

export default defineConfig({ plugins: [ laravel({ input: ["resources/css/app.css", "resources/js/app.js"], refresh: true, }), vue(), ], build: { // The outDir should be set to your public directory outDir: 'public/build', }, });

The assets were built successfully, but the build is inside the public directory. The resources are being referenced with the incorrect path, which is why my CSS and JS files are not loading. When I manually add 'public' before 'build' in the path, the CSS and JS files load correctly. Please guide me on how to fix this issue.

0 likes
1 reply

Please or to participate in this conversation.