import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import vue from "@vitejs/plugin-vue";
import path from "path";
import Components from "unplugin-vue-components/vite";
import viteCompression from "vite-plugin-compression";

export default defineConfig({
  plugins: [
    viteCompression(),
    vue(),
    laravel({
      input: [
        "resources/sass/admin-app.scss",
        "resources/js/admin-app.js",
        "resources/sass/front-app.scss",
        "resources/js/front-app.js",
      ],
      refresh: true,
    }),
    Components({
      dirs: ["resources/js/vue"],
      dts: false,
    }),
  ],
  resolve: {
    alias: {
      vue: "vue/dist/vue.esm-bundler.js",
      "@": path.resolve(__dirname, "./resources/js"),
      "~": path.resolve(__dirname, "node_modules"),
      "~bootstrap": path.resolve(__dirname, "node_modules/bootstrap"),
    },
  },
});
