-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
electron.vite.config.1732526586142.mjs
72 lines (72 loc) · 2.13 KB
/
electron.vite.config.1732526586142.mjs
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
// electron.vite.config.ts
import vue from "@vitejs/plugin-vue";
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import { merge } from "lodash-es";
import { resolve } from "path";
import svgLoader from "vite-svg-loader";
var __electron_vite_injected_dirname = "E:\\git\\ytmdesktop2";
var resolveOptions = {
resolve: {
alias: {
"@renderer": resolve("src/renderer/src"),
"@main": resolve("src/main"),
"@preload": resolve("src/preload"),
"@shared": resolve("src/shared"),
"@translations": resolve("src/translations"),
"@": resolve("src"),
"~": resolve(".")
}
}
};
var externalizedEsmDeps = ["lodash-es", "@faker-js/faker", "@trpc-limiter/memory", "got", "encryption.js"];
var electron_vite_config_default = defineConfig({
main: {
...resolveOptions,
plugins: [externalizeDepsPlugin({ exclude: [...externalizedEsmDeps] })],
build: {
rollupOptions: {
input: {
index: resolve(__electron_vite_injected_dirname, "src/main/main.ts")
},
output: {
manualChunks: (id) => {
if (externalizedEsmDeps.find((d) => d === id)) return id;
}
}
}
}
},
preload: {
...resolveOptions,
plugins: [externalizeDepsPlugin({ exclude: [...externalizedEsmDeps] })],
build: {
rollupOptions: {
input: {
"youtube": resolve(__electron_vite_injected_dirname, "src/preload/youtube.ts"),
"api": resolve(__electron_vite_injected_dirname, "src/preload/api.ts"),
"login": resolve(__electron_vite_injected_dirname, "src/preload/login.ts")
}
}
}
},
renderer: {
...merge({}, resolveOptions, {
resolve: {
alias: {
"@": resolve(__electron_vite_injected_dirname, "src/renderer/src")
}
}
}),
plugins: [
// (TanStackRouterVite as typeof TanStackRouterViteType)({
// generatedRouteTree: resolve('./src/renderer/src/routeTree.gen.ts'),
// routesDirectory: resolve('./src/renderer/src/routes')
// }),
vue(),
svgLoader()
]
}
});
export {
electron_vite_config_default as default
};