-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.renderer.config.js
41 lines (38 loc) · 994 Bytes
/
vite.renderer.config.js
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
39
40
41
import { defineConfig } from 'vite';
import { pluginExposeRenderer } from './vite.base.config.js';
import { fileURLToPath } from 'url';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
// https://vitejs.dev/config
export default defineConfig((env) => {
/** @type {import('vite').ConfigEnv<'renderer'>} */
const forgeEnv = env;
const { root, mode, forgeConfigSelf } = forgeEnv;
const name = forgeConfigSelf.name ?? '';
/** @type {import('vite').UserConfig} */
return {
root,
mode,
base: './',
build: {
outDir: `.vite/renderer/${name}`,
},
plugins: [pluginExposeRenderer(name), nodePolyfills()],
resolve: {
preserveSymlinks: true,
alias: {
"@": fileURLToPath(new URL('src/', import.meta.url)),
}
},
worker: {
rollupOptions: {
output: {
inlineDynamicImports: true,
}
}
},
clearScreen: false,
define: {
__BUILD_MODE__: `"electron"`,
}
};
});