aboutsummaryrefslogtreecommitdiff
path: root/web/pw-visualizer/vite.config.js
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2021-12-29 21:24:57 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2021-12-29 21:25:29 +0100
commit0c6d978442b244ca3f29c1ffdd44b5007ae7ad93 (patch)
treebaae5fa459a49ecd362e548e0649e2f58c669a70 /web/pw-visualizer/vite.config.js
parent3eeaab6cec70e7a06a99a1ac2662974f71064bee (diff)
downloadplanetwars.dev-0c6d978442b244ca3f29c1ffdd44b5007ae7ad93.tar.xz
planetwars.dev-0c6d978442b244ca3f29c1ffdd44b5007ae7ad93.zip
separate out visualizer library
Diffstat (limited to 'web/pw-visualizer/vite.config.js')
-rw-r--r--web/pw-visualizer/vite.config.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/web/pw-visualizer/vite.config.js b/web/pw-visualizer/vite.config.js
new file mode 100644
index 0000000..61eed3e
--- /dev/null
+++ b/web/pw-visualizer/vite.config.js
@@ -0,0 +1,24 @@
+import { defineConfig } from 'vite'
+import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
+import wasmPack from 'vite-plugin-wasm-pack';
+
+// https://vitejs.dev/config/
+export default defineConfig({
+ plugins: [
+ wasmPack([], ["planetwars-rs"]),
+ viteCommonjs({
+ transformMixedEsModules: true,
+ }),
+ ],
+ build: {
+ commonjsOptions: {
+ transformMixedEsModules: true,
+ },
+ },
+ server: {
+ proxy: {
+ "/api/": "http://localhost:5000",
+ "/ws": "ws://localhost:5000/ws",
+ },
+ },
+})