import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import path from "path";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
  plugins: [react(), tailwindcss(), tsconfigPaths()],
  resolve: {
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
  server: {
    host: true,
    port: 5173,
    allowedHosts: ["*"],
  },
  preview: {
    host: true,
    port: 5263,
    allowedHosts: ["*"],
  },
  build: {
    outDir: "dist",
    sourcemap: false,
  },
  base: "/", // ✅ assetlar to‘g‘ri yuklanadi
});
