import vue from "@vitejs/plugin-vue";
import path from "path";
import { defineConfig, loadEnv } from "vite";
import VitePluginUploadPackage from "./VitePluginUploadPackage";

// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
    process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
    return {
        base: process.env.VITE_BASE_URL,
        plugins: [vue(), VitePluginUploadPackage()],
        resolve: {
            alias: {
                "@": path.resolve(__dirname, "./src"),
            },
        },
        server: {
            host: "0.0.0.0",
            port: 4173,
        },
    };
});
