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

// https://vitejs.dev/config/
export default ({ mode }) => {
	process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
	return defineConfig({
		resolve: {
			alias: {
				"@root": path.resolve(__dirname, "./"),
				"@": path.resolve(__dirname, "./src"),
			},
		},
		plugins: [react()],
	});
};
