planetwars.dev/web/pw-server/svelte.config.js

55 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-02-24 18:38:17 +01:00
import adapter from "@sveltejs/adapter-node";
2022-07-27 21:04:51 +02:00
import sveltePreprocess from "svelte-preprocess";
2021-12-31 11:38:06 +01:00
import { viteCommonjs } from "@originjs/vite-plugin-commonjs";
import wasmPack from "vite-plugin-wasm-pack";
import { isoImport } from "vite-plugin-iso-import";
2022-07-27 21:04:51 +02:00
import { mdsvex } from "mdsvex";
2021-12-30 14:15:40 +01:00
/** @type {import('@sveltejs/kit').Config} */
const config = {
2021-12-31 11:38:06 +01:00
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
2022-07-27 21:04:51 +02:00
preprocess: [
sveltePreprocess(),
mdsvex({
2022-07-28 20:32:10 +02:00
extensions: ['.md'],
layout: {
docs: 'src/routes/docs/doc.svelte',
}
2022-07-27 21:04:51 +02:00
}),
],
extensions: ['.svelte', '.md'],
2021-12-31 11:38:06 +01:00
kit: {
adapter: adapter(),
2021-12-30 14:15:40 +01:00
2021-12-31 11:38:06 +01:00
// hydrate the <div id="svelte"> element in src/app.html
2022-02-24 18:47:36 +01:00
// target: "#svelte",
2021-12-31 11:38:06 +01:00
vite: {
plugins: [
isoImport(),
2022-01-02 17:57:40 +01:00
wasmPack([], ["planetwars-rs"]),
2021-12-31 11:38:06 +01:00
viteCommonjs({
transformMixedEsModules: true,
}),
],
build: {
commonjsOptions: {
transformMixedEsModules: true,
},
},
server: {
proxy: {
2022-02-24 18:47:36 +01:00
"/api/": "http://127.0.0.1:9000",
2021-12-31 11:38:06 +01:00
"/ws": "ws://localhost:9000/ws",
},
fs: {
// Allow serving files from one level up to the project root
allow: [".."],
},
},
},
},
2021-12-30 14:15:40 +01:00
};
export default config;