39 lines
946 B
TypeScript
39 lines
946 B
TypeScript
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";
|
||
|
||
const allowedHosts = (
|
||
process.env.VITE_ALLOWED_HOSTS || "admin.simpletravel.uz"
|
||
).split(",");
|
||
|
||
export default defineConfig({
|
||
plugins: [
|
||
react(), // React uchun
|
||
tailwindcss(), // Tailwind CSS integratsiyasi
|
||
tsconfigPaths(), // @ alias yo‘llarini avtomatik o‘qish
|
||
],
|
||
resolve: {
|
||
alias: {
|
||
"@": path.resolve(__dirname, "./src"),
|
||
},
|
||
},
|
||
server: {
|
||
host: true,
|
||
port: 5173,
|
||
allowedHosts,
|
||
},
|
||
preview: {
|
||
host: true,
|
||
port: 5263,
|
||
allowedHosts,
|
||
},
|
||
|
||
build: {
|
||
outDir: "dist", // Vercel build chiqishini shu papkadan oladi
|
||
sourcemap: false, // Agar kerak bo‘lmasa o‘chirib qo‘ying
|
||
},
|
||
base: "/", // <— Muhim: nisbiy yo‘l, Vercel’da assetlar to‘g‘ri yuklanadi
|
||
});
|