aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/svelte.config.js
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2021-12-30 14:15:40 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2021-12-30 14:15:40 +0100
commit522f4270e83a85564ecc977aa470fcf8560547e2 (patch)
tree0dc688bde37aecd470a259bccc89f8bf3d24e710 /web/pw-server/svelte.config.js
parent3edf5d60f54bfd0cd2c818e5fb1ca133e324325d (diff)
downloadplanetwars.dev-522f4270e83a85564ecc977aa470fcf8560547e2.tar.xz
planetwars.dev-522f4270e83a85564ecc977aa470fcf8560547e2.zip
init SvelteKit frontend
Diffstat (limited to 'web/pw-server/svelte.config.js')
-rw-r--r--web/pw-server/svelte.config.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/web/pw-server/svelte.config.js b/web/pw-server/svelte.config.js
new file mode 100644
index 0000000..14e6a05
--- /dev/null
+++ b/web/pw-server/svelte.config.js
@@ -0,0 +1,49 @@
+import adapter from '@sveltejs/adapter-auto';
+import preprocess from 'svelte-preprocess';
+// import { svelte } from '@sveltejs/vite-plugin-svelte'
+import { viteCommonjs } from '@originjs/vite-plugin-commonjs'
+import wasmPack from 'vite-plugin-wasm-pack';
+
+
+/** @type {import('@sveltejs/kit').Config} */
+const config = {
+ // Consult https://github.com/sveltejs/svelte-preprocess
+ // for more information about preprocessors
+ preprocess: preprocess(),
+
+ kit: {
+ adapter: adapter(),
+
+ // hydrate the <div id="svelte"> element in src/app.html
+ target: '#svelte',
+ ssr: false,
+ vite: {
+ plugins: [
+ // svelte(),
+ // wasmPack([], ["planetwars-rs"]),
+ viteCommonjs({
+ transformMixedEsModules: true,
+ }),
+ ],
+ build: {
+ commonjsOptions: {
+ transformMixedEsModules: true,
+ },
+ },
+ server: {
+ proxy: {
+ "/api/": "http://localhost:9000",
+ "/ws": "ws://localhost:9000/ws",
+ },
+ fs: {
+ // Allow serving files from one level up to the project root
+ allow: ['..']
+ }
+ },
+ }
+
+ },
+
+};
+
+export default config;