forked from beyond-all-reason/bar-lobby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.main.config.mts
47 lines (45 loc) · 1.43 KB
/
vite.main.config.mts
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
import { defineConfig } from "vite";
import { viteStaticCopy } from "vite-plugin-static-copy";
import path from "path";
// https://vitejs.dev/config
export default defineConfig({
resolve: {
alias: {
"@main": path.join(__dirname, "src/main"),
"@renderer": path.join(__dirname, "src/renderer"),
"@preload": path.join(__dirname, "src/preload"),
$: path.join(__dirname, "vendor"),
},
},
build: {
rollupOptions: {
input: {
main: path.resolve(__dirname, "src/main/main.ts"),
"parse-replay-worker": path.resolve(__dirname, "src/main/content/replays/parse-replay-worker.ts"),
"map-image-worker": path.resolve(__dirname, "src/main/content/maps/map-image-worker.ts"),
},
},
lib: {
entry: path.resolve(__dirname, "src/main/main.ts"),
formats: ["cjs"],
fileName(format, entryName) {
return `${entryName}.cjs`;
},
},
sourcemap: true,
},
plugins: [
viteStaticCopy({
targets: [
{
src: "node_modules/7zip-bin/win/x64/7za.exe",
dest: "./win/x64/",
},
{
src: "node_modules/7zip-bin/linux/x64/7za",
dest: "./linux/x64/",
},
],
}),
],
});