forked from intechstudio/grid-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron.vite.config.mjs
48 lines (47 loc) · 1.24 KB
/
electron.vite.config.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
import { defineConfig, externalizeDepsPlugin } from "electron-vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";
import preprocess from "svelte-preprocess";
import path, { resolve } from "path";
import monacoEditorPlugin from "vite-plugin-monaco-editor";
import { rendererConfig } from "./renderer.vite.config.mjs";
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()],
define: {
"process.env": "process.env",
},
optimizeDeps: {
include: ["esm-dep > cjs-dep"],
},
build: {
rollupOptions: {
input: {
index: resolve(__dirname, "src/electron/main.ts"),
packageManager: resolve(
__dirname,
"src/electron/package/packageManager.ts"
),
},
},
outDir: "dist/main",
},
},
preload: {
plugins: [externalizeDepsPlugin()],
define: {
"process.env": "process.env",
},
build: {
rollupOptions: {
input: {
index: resolve(__dirname, "src/electron/preload.ts"),
package: resolve(__dirname, "src/electron/preload_package.ts"),
},
},
outDir: "dist/preload",
},
},
renderer: {
...rendererConfig({ outDir: "dist/renderer" }),
},
});