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

export default defineConfig({
    plugins: [
        vue(),
        laravel({
            input: [
                "resources/css/app.css",
                "resources/js/app.js",
            ],
            refresh: true,
        }),
    ],
    resolve: {
        alias: {
            vue: "vue/dist/vue.esm.js",
        },
    },
    build: {
        rollupOptions: {
            output: {
                manualChunks(id) {
                    if (id.includes("node_modules")) {
                        return "vendor"; // Barcha node_modules bo'lgan qismlarni "vendor" deb nomlangan bo'lakka ajratadi
                    }
                },
            },
        },
        chunkSizeWarningLimit: 2000, // Ogohlantirish limitini oshirish
    },
});
