forked from siddharthvaddem/openscreen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
60 lines (59 loc) · 1.33 KB
/
vite.config.ts
File metadata and controls
60 lines (59 loc) · 1.33 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
import path from "node:path";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import electron from "vite-plugin-electron/simple";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react(),
electron({
main: {
entry: "electron/main.ts",
onstart({ startup }) {
const env = { ...process.env };
delete env.ELECTRON_RUN_AS_NODE;
return startup(["."], { env });
},
vite: {
build: {},
},
},
preload: {
input: path.join(__dirname, "electron/preload.ts"),
},
renderer: process.env.NODE_ENV === "test" ? undefined : {},
}),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
},
},
build: {
target: "esnext",
minify: "terser",
terserOptions: {
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ["console.log", "console.debug"],
},
},
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes("pixi.js") || id.includes("pixi-filters") || id.includes("@pixi/"))
return "pixi";
if (id.includes("react-dom") || id.includes("/react/")) return "react-vendor";
if (
id.includes("mediabunny") ||
id.includes("mp4box") ||
id.includes("fix-webm-duration")
)
return "video-processing";
},
},
},
chunkSizeWarningLimit: 1000,
},
});