-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.renderer.config.ts
34 lines (32 loc) · 1008 Bytes
/
vite.renderer.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
33
34
import type { ConfigEnv, UserConfig } from "vite";
import { defineConfig } from "vite";
import pluginTsconfigPaths from "vite-tsconfig-paths";
import { productName, version } from "./package.json";
import { pluginExposeRenderer } from "./vite.base.config";
// https://vitejs.dev/config
export default defineConfig((env) => {
const forgeEnv = env as ConfigEnv<"renderer">;
const { root, mode, forgeConfigSelf } = forgeEnv;
const name = forgeConfigSelf.name ?? "";
return {
root,
mode,
base: "./",
build: {
outDir: `.vite/renderer/${name}`,
},
plugins: [pluginExposeRenderer(name), pluginTsconfigPaths()],
resolve: {
preserveSymlinks: true,
},
clearScreen: false,
define: {
__DARWIN__: process.platform === "darwin",
__WIN32__: process.platform === "win32",
__LINUX__: process.platform === "linux",
__APP_NAME__: JSON.stringify(productName),
__APP_VERSION__: JSON.stringify(version),
__DEV__: process.env.NODE_ENV === "development",
},
} as UserConfig;
});