forked from yaagl/yet-another-anime-game-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
32 lines (30 loc) · 819 Bytes
/
vite.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
30
31
32
/// <reference types="vitest" />
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
import tsconfigPaths from "vite-tsconfig-paths";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [tsconfigPaths(), {
name: "channel-client switcher",
load: (id) => {
if(id.endsWith("/src/clients/index.ts")) {
const cc = process.env["YAAGL_CHANNEL_CLIENT"] ?? "hk4ecn";
console.info(`Building channel client ${cc}`);
return `export * from './${cc}'`;
}
return null;
}
}, solidPlugin()],
envPrefix: ["VITE_", "YAAGL_"],
build: {
target: "safari13",
minify: true,
sourcemap: false,
outDir: "dist",
rollupOptions: {},
},
test: {
include: ["src/**/*.spec.ts"],
environment: "node",
},
});