Skip to content

Commit f529778

Browse files
authored
fix: resolve main build issues (#56)
1 parent 05b9a09 commit f529778

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

build/Assets.car

0 Bytes
Binary file not shown.

vite.main.config.mts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import { copyFileSync, mkdirSync } from "node:fs";
2-
import { join } from "node:path";
2+
import path, { join } from "node:path";
3+
import { fileURLToPath } from "node:url";
34
import { defineConfig, type Plugin } from "vite";
45

6+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
7+
58
/**
69
* Custom Vite plugin to fix circular __filename references in bundled ESM packages.
710
*
@@ -56,6 +59,15 @@ function copyAgentTemplates(): Plugin {
5659

5760
export default defineConfig({
5861
plugins: [fixFilenameCircularRef(), copyAgentTemplates()],
62+
resolve: {
63+
alias: {
64+
"@": path.resolve(__dirname, "./src"),
65+
"@main": path.resolve(__dirname, "./src/main"),
66+
"@renderer": path.resolve(__dirname, "./src/renderer"),
67+
"@shared": path.resolve(__dirname, "./src/shared"),
68+
"@api": path.resolve(__dirname, "./src/api"),
69+
},
70+
},
5971
build: {
6072
target: "node18",
6173
minify: false, // Disable minification to prevent variable name conflicts

0 commit comments

Comments
 (0)