-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
electron.vite.config.ts
36 lines (34 loc) · 1.05 KB
/
electron.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
33
34
35
36
import { defineConfig, externalizeDepsPlugin } from 'electron-vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
main: {
// https://electron-vite.org/guide/dev#dependencies-vs-devdependencies
// For the main process and preload, the best practice is to externalize dependencies and only bundle our own code.
// However, until we use ESM for electron main, we need to include ESM-only deps in the bundle: (exclude from externalize)
plugins: [externalizeDepsPlugin({ exclude: ['p-map', 'execa', 'nanoid', 'file-type'] })],
build: {
target: 'node20.14',
sourcemap: true,
},
},
preload: {
// https://electron-vite.org/guide/dev#dependencies-vs-devdependencies
plugins: [externalizeDepsPlugin({ exclude: [] })],
build: {
target: 'node20.14',
sourcemap: true,
},
},
renderer: {
plugins: [react()],
build: {
target: 'chrome126',
sourcemap: true,
chunkSizeWarningLimit: 3e6,
},
server: {
port: 3001,
host: '127.0.0.1',
},
},
});