import { defineConfig } from "vite"; import laravel from "laravel-vite-plugin"; import path from "path"; import tailwindcss from "@tailwindcss/postcss"; import postcssImport from "postcss-import"; import autoprefixer from "autoprefixer"; export default defineConfig({ plugins: [ laravel({ input: [ path.resolve(__dirname, "css/app.scss"), path.resolve(__dirname, "js/app.js"), "resources/js/global.js", "resources/css/global.scss", ], }), { name: "blade", handleHotUpdate({ file, server }) { if (file.endsWith(".blade.php")) { server.ws.send({ type: "full-reload", path: "*", }); } }, }, ], resolve: { alias: { "@": path.resolve(__dirname, "js/app.js"), }, }, css: { postcss: { plugins: [ postcssImport(), tailwindcss({ config: path.resolve(__dirname, "tailwind.config.cjs"), }), autoprefixer(), ], }, }, build: { rollupOptions: { onwarn(warning, warn) { if (warning.code === 'INVALID_ANNOTATION') return; warn(warning); } } }, });