-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.renderer.config.ts
38 lines (36 loc) · 1.07 KB
/
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
35
36
37
38
import react from "@vitejs/plugin-react";
import type {ConfigEnv, UserConfig} from 'vite';
import {defineConfig} from 'vite';
import {ViteImageOptimizer} from "vite-plugin-image-optimizer";
import {nodePolyfills} from "vite-plugin-node-polyfills";
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),
react(),
ViteImageOptimizer(),
nodePolyfills({
globals: {
Buffer: true,
global: true,
process: true,
},
})
],
resolve: {
preserveSymlinks: true,
},
clearScreen: false,
} as UserConfig;
});