summaryrefslogtreecommitdiff
path: root/client/vite.config.ts
blob: cdf1ab18e088b8f45db5ac2297a51f55214abdd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import { fileURLToPath, URL } from "node:url";

// https://vitejs.dev/config/
export default defineConfig({
  server: {
    proxy: {
      "/api": {
        target: "http://localhost:8080",
        ws: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
  cors: true,
  plugins: [svelte()],
  resolve: {
    alias: {
      "@engine": fileURLToPath(new URL("../engine", import.meta.url)),
    },
  },
});