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

const port = process.env.PORT ? parseInt(process.env.PORT, 10) : 5000;

export default defineConfig({
  plugins: [reactRouter(), tsconfigPaths()],
  server: {
    port,
    allowedHosts: [".trycloudflare.com", "localhost", "127.0.0.1"],
    hmr: {
      protocol: "ws",
    },
  },
});
