-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvite.itchio.config.ts
29 lines (28 loc) · 946 Bytes
/
vite.itchio.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// This config file includes some customizations for hosting on itch.io.
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import wasmPack from "vite-plugin-wasm-pack";
export default defineConfig(async () => {
const mdx = await import("@mdx-js/rollup");
// @ts-ignore
const remarkGfm = await import("remark-gfm");
return {
// Set base="" for itch.io. This causes all assets to use relative paths,
// which is required. See https://itch.io/docs/creators/html5
base: "",
root: "web",
build: {
outDir: `dist-itchio-${process.env.npm_package_version}`,
},
plugins: [
wasmPack("./elara-lib"),
react(),
mdx.default({ remarkPlugins: [remarkGfm.default as any] }),
],
define: {
"import.meta.vitest": "undefined",
APP_VERSION: JSON.stringify(process.env.npm_package_version),
ELARA_BUILD_TARGET: JSON.stringify("itchio"),
},
};
});