29 lines
662 B
TypeScript
29 lines
662 B
TypeScript
import { defineConfig } from "vite";
|
|
import react from "@vitejs/plugin-react";
|
|
|
|
const serverRoutes = ["/access", "/buy/start", "/buy/complete", "/buy/cancel"];
|
|
const baseServerConfigBuilder = (domain: string) => ({
|
|
proxy: Object.fromEntries(
|
|
serverRoutes.map((key) => [
|
|
key,
|
|
{
|
|
target: `http://${domain}:3000`,
|
|
changeOrigin: true,
|
|
secure: false,
|
|
},
|
|
]),
|
|
),
|
|
port: 8000,
|
|
strictPort: true,
|
|
});
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
server: {
|
|
...baseServerConfigBuilder("localhost"),
|
|
host: true,
|
|
},
|
|
preview: baseServerConfigBuilder("paysplit-app"),
|
|
plugins: [react()],
|
|
});
|