import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import path from "path";

export default defineConfig({
    build: {
        outDir: "public/build",
        manifest: true, // Menghasilkan manifest.json untuk Laravel
    },
    resolve: {
        alias: {
            "@": path.resolve(__dirname, "resources/js"),
        },
    },
    plugins: [
        laravel({
            input: [
                //css
                "resources/scss/icons.scss",
                "resources/scss/style.scss",
                "resources/scss/components/_circle.scss",

                "node_modules/quill/dist/quill.snow.css",
                "node_modules/quill/dist/quill.bubble.css",
                "node_modules/flatpickr/dist/flatpickr.min.css",
                "node_modules/flatpickr/dist/themes/dark.css",
                "node_modules/gridjs/dist/theme/mermaid.css",
                "node_modules/flatpickr/dist/themes/dark.css",
                "node_modules/gridjs/dist/theme/mermaid.min.css",

                //js
                "resources/js/app.js",
                "resources/js/config.js",
                "resources/js/pages/dashboard.js",
                "resources/js/pages/chart.js",
                "resources/js/pages/form-quilljs.js",
                "resources/js/pages/form-fileupload.js",
                "resources/js/pages/form-flatepicker.js",
                "resources/js/pages/table-gridjs.js",
                "resources/js/pages/maps-google.js",
                "resources/js/pages/maps-vector.js",
                "resources/js/pages/maps-spain.js",
                "resources/js/pages/maps-russia.js",
                "resources/js/pages/maps-iraq.js",
                "resources/js/pages/maps-canada.js",

                //js-additional
                "resources/js/dashboards/bigdata.js",
                "resources/js/settings/syncronize/syncronize.js",
                "resources/js/data-settings/index.js",
                "resources/js/pbg-task/index.js",
                "resources/js/settings/general/general-settings.js",
                "resources/js/tables/common-table.js",
                // roles
                "resources/js/roles/index.js",
                "resources/js/roles/create.js",
                "resources/js/roles/update.js",
                "resources/roles/role_menu.js",
                // users
                "resources/js/master/users/users.js",
                "resources/js/master/users/create.js",
                "resources/js/master/users/update.js",
                // menus
                "resources/js/menus/index.js",
                "resources/js/menus/create.js",
                "resources/js/menus/update.js",
            ],
            refresh: true,
        }),
    ],
});
