-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelectron.vite.config.ts
More file actions
73 lines (71 loc) · 1.69 KB
/
Copy pathelectron.vite.config.ts
File metadata and controls
73 lines (71 loc) · 1.69 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { resolve } from "path";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import react from "@vitejs/plugin-react";
const isDevelopment = process.env.NODE_ENV === "development";
export default defineConfig({
main: {
resolve: {
alias: {
"@shared": resolve("src/shared"),
},
},
plugins: [externalizeDepsPlugin()],
build: {
sourcemap: isDevelopment,
watch: isDevelopment
? {
include: "src/main/**",
}
: undefined,
rollupOptions: {
input: {
main: resolve(__dirname, "src/main/main.ts"),
"workers/downloadWorker": resolve(__dirname, "src/main/workers/downloadWorker.ts"),
"workers/vacuumWorker": resolve(__dirname, "src/main/workers/vacuumWorker.ts"),
},
output: {
dir: "out/main",
format: "cjs",
entryFileNames: "[name].cjs",
},
},
},
},
preload: {
resolve: {
alias: {
"@shared": resolve("src/shared"),
},
},
plugins: [externalizeDepsPlugin()],
build: {
sourcemap: isDevelopment,
watch: isDevelopment ? {} : undefined,
lib: {
entry: "src/main/bridge.ts",
formats: ["cjs"],
},
rollupOptions: {
output: {
entryFileNames: "[name].cjs",
},
},
},
},
renderer: {
root: "src/renderer",
resolve: {
alias: {
"@": resolve(__dirname, "src/renderer"),
"@shared": resolve("src/shared"),
},
},
build: {
sourcemap: isDevelopment,
rollupOptions: {
input: "src/renderer/index.html",
},
},
plugins: [react()],
},
});