-
Notifications
You must be signed in to change notification settings - Fork 2
/
electron.vite.config.ts
62 lines (61 loc) · 1.77 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
import react from "@vitejs/plugin-react";
import { TanStackRouterVite } from "@tanstack/router-vite-plugin";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import { resolve } from "node:path";
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
build: {
outDir: "dist/main",
lib: { entry: "src/main.ts" },
rollupOptions: { external: ["better-sqlite3"] },
},
resolve: {
alias: {
"@src": resolve(__dirname, "src/"),
"@shared": resolve(__dirname, "src/shared/"),
"@components": resolve(__dirname, "src/web/components/"),
"@assets": resolve(__dirname, "src/assets/"),
"@pages": resolve(__dirname, "src/web/pages"),
},
},
},
preload: {
plugins: [externalizeDepsPlugin()],
build: {
outDir: "dist/preload",
// tell electron-vite where to look for your preload file
lib: { entry: "src/preload.ts" },
},
},
renderer: {
// tell electron-vite where your web entry point is
root: "src/web/",
resolve: {
// path aliases
alias: {
"@src": resolve(__dirname, "src/"),
"@shared": resolve(__dirname, "src/shared/"),
"@components": resolve(__dirname, "src/web/components/"),
"@assets": resolve(__dirname, "src/assets/"),
"@pages": resolve(__dirname, "src/web/pages"),
},
},
plugins: [
react(),
TanStackRouterVite({
routesDirectory: "./src/web/routes",
generatedRouteTree: "./src/web/routeTree.gen.ts",
routeFileIgnorePrefix: "-",
quoteStyle: "single"
}),
],
// where to output your web files
build: {
outDir: "dist/renderer",
rollupOptions: {
input: "./src/web/index.html",
},
},
},
});