aboutsummaryrefslogtreecommitdiff
path: root/web/pw-frontend/vite.config.js
blob: 68e02e2d537d7b8f7e03de3c3b80b5a568a65392 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
import wasmPack from 'vite-plugin-wasm-pack';

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    svelte(),
    wasmPack([], ["planetwars-rs"]),
    viteCommonjs({
      transformMixedEsModules: true,
    }),
  ],
  build: {
    commonjsOptions: {
      transformMixedEsModules: true,
    },
  },
  server: {
    proxy: {
      "/api/": "http://localhost:5000",
      "/ws": "ws://localhost:5000/ws",
    },
    fs: {
      // Allow serving files from one level up to the project root
      allow: ['..']
    }
  },
})