-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathelectron.vite.config.ts
70 lines (69 loc) · 1.81 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
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
import { resolve } from "node:path";
import { nodeResolve } from "@rollup/plugin-node-resolve";
import react from "@vitejs/plugin-react";
import { defineConfig } from "electron-vite";
import tsconfigPaths from "vite-tsconfig-paths";
export default defineConfig({
main: {
plugins: [tsconfigPaths(), nodeResolve()],
optimizeDeps: {
force: true, // TODO: vite cache is not working with monorepo deps updates
},
build: {
outDir: "out/app/dist/main",
rollupOptions: {
output: {
format: "cjs",
},
preserveSymlinks: true,
},
},
},
preload: {
plugins: [tsconfigPaths()],
optimizeDeps: {
force: true, // TODO: vite cache is not working with monorepo deps updates
},
build: {
outDir: "out/app/dist/preload",
rollupOptions: {
input: {
index: resolve(__dirname, "src/preload/index.ts"),
},
preserveSymlinks: true,
output: {
format: "cjs",
},
},
},
},
renderer: {
resolve: {
alias: {
"@renderer": resolve("src/renderer/src"),
},
},
plugins: [react(), nodeResolve()],
optimizeDeps: {
force: true, // TODO: vite cache is not working with monorepo deps updates
},
build: {
outDir: "out/app/dist/renderer",
rollupOptions: {
input: {
launcher: resolve(__dirname, "src/renderer/index.html"),
authComplete: resolve(__dirname, "src/renderer/auth/index.html"),
},
output: {
entryFileNames: (chunkInfo) => {
if (chunkInfo.name === "authComplete") {
return "auth/auth-bundle.js";
}
return "assets/[name].js";
},
assetFileNames: () => "public/[name][extname]",
},
},
},
},
});