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";
|
2022-02-07 20:56:08 +01:00
|
|
|
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: [
|
2022-02-07 20:56:08 +01:00
|
|
|
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;
|