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

export default defineConfig({
  plugins: [react()],
  server: {
    port: 5100,
    strictPort: true,
    host: true, // Listen on all addresses
    allowedHosts: [
      ".ddns.net",
      "houseofprayer.ddns.net",
      "localhost",
      ".localhost",
      "192.168.10.130",
      "127.0.0.1",
    ],
    proxy: {
      "/api": {
        target: "http://localhost:8080",
        changeOrigin: true,
      },
    },
    hmr: {
      protocol: "wss",
      host: "houseofprayer.ddns.net",
      port: 443,
      clientPort: 443,
    },
  },
  resolve: {
    alias: {
      "@": "/src",
      "@components": "/src/components",
      "@pages": "/src/pages",
      "@layouts": "/src/layouts",
      "@hooks": "/src/hooks",
      "@utils": "/src/utils",
      "@animations": "/src/animations",
      "@themes": "/src/themes",
      "@assets": "/src/assets",
      "@context": "/src/context",
      "@stores": "/src/stores",
    },
  },
});
