-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathelectron.vite.config.ts
48 lines (47 loc) · 1.14 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
import { resolve } from "path"
import { defineConfig, externalizeDepsPlugin } from "electron-vite"
import react from "@vitejs/plugin-react"
import { comlink } from "vite-plugin-comlink"
import arraybuffer from "vite-plugin-arraybuffer"
import glslify from "rollup-plugin-glslify"
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
},
preload: {
plugins: [externalizeDepsPlugin()],
},
renderer: {
resolve: {
alias: {
"@src": resolve("src/renderer/src"),
"@lib": resolve("src/renderer/lib"),
},
},
define: {
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
},
plugins: [
react(),
comlink(),
arraybuffer(),
glslify({
compress: false,
// @ts-ignore - glslify options are not typed
transform: ["glslify-import"],
}),
],
worker: {
format: "es",
plugins: () => [
comlink(),
arraybuffer(),
glslify({
compress: false,
// @ts-ignore - glslify options are not typed
transform: ["glslify-import"],
}),
],
},
},
})