import { reactRouter } from "@react-router/dev/vite";
import tailwindcss from "@tailwindcss/vite";
import { defineConfig, loadEnv } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig(({ mode }) => {

    const env = loadEnv(mode, process.cwd(), '');
    return {
        plugins: [tailwindcss(), reactRouter(), tsconfigPaths()],
        server: {
            port: parseInt(env.VITE_PORT),
        },
        build: {
            sourcemap: false,
        }
    };
});

