2021-12-22 12:59:13 +00:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
2021-12-23 17:22:14 +00:00
|
|
|
import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
|
2021-12-23 18:25:56 +00:00
|
|
|
import wasmPack from 'vite-plugin-wasm-pack';
|
2021-12-22 12:59:13 +00:00
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [
|
|
|
|
svelte(),
|
2021-12-29 20:24:57 +00:00
|
|
|
wasmPack([], ["planetwars-rs"]),
|
2021-12-23 17:22:14 +00:00
|
|
|
viteCommonjs({
|
|
|
|
transformMixedEsModules: true,
|
|
|
|
}),
|
2021-12-22 12:59:13 +00:00
|
|
|
],
|
2021-12-23 17:22:14 +00:00
|
|
|
build: {
|
|
|
|
commonjsOptions: {
|
|
|
|
transformMixedEsModules: true,
|
|
|
|
},
|
2021-12-25 19:28:10 +00:00
|
|
|
},
|
|
|
|
server: {
|
|
|
|
proxy: {
|
|
|
|
"/api/": "http://localhost:5000",
|
2021-12-27 21:18:46 +00:00
|
|
|
"/ws": "ws://localhost:5000/ws",
|
2021-12-25 19:28:10 +00:00
|
|
|
},
|
2021-12-29 21:54:30 +00:00
|
|
|
fs: {
|
|
|
|
// Allow serving files from one level up to the project root
|
|
|
|
allow: ['..']
|
|
|
|
}
|
2021-12-23 17:22:14 +00:00
|
|
|
},
|
2021-12-22 12:59:13 +00:00
|
|
|
})
|