Skip to content

Commit e67cc98

Browse files
committed
fix: bundle pi bridge dependencies
1 parent f6f25c5 commit e67cc98

2 files changed

Lines changed: 22 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opengui",
3-
"version": "0.5.9",
3+
"version": "0.5.10",
44
"private": false,
55
"description": "OpenGUI - Desktop and web command center for coding agents",
66
"homepage": "https://github.com/akemmanuel/OpenGUI",

vite.electron.config.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,26 @@ const externals = new Set([
2323
...Object.keys(pkg.dependencies ?? {}),
2424
]);
2525

26+
const bundledPackagePrefixes = [
27+
"@earendil-works/pi-agent-core",
28+
"@earendil-works/pi-ai",
29+
"@earendil-works/pi-coding-agent",
30+
"@earendil-works/pi-tui",
31+
];
32+
33+
function packageIdFor(id: string) {
34+
const [scopeOrName, packageName] = id.split("/");
35+
return scopeOrName?.startsWith("@") ? `${scopeOrName}/${packageName}` : scopeOrName;
36+
}
37+
38+
function isBundledPackage(id: string) {
39+
return bundledPackagePrefixes.some((prefix) => id === prefix || id.startsWith(`${prefix}/`));
40+
}
41+
2642
function isExternal(id: string) {
2743
if (id.startsWith("node:")) return true;
28-
const [scopeOrName, packageName] = id.split("/");
29-
const packageId = scopeOrName?.startsWith("@") ? `${scopeOrName}/${packageName}` : scopeOrName;
44+
if (isBundledPackage(id)) return false;
45+
const packageId = packageIdFor(id);
3046
return Boolean(packageId && externals.has(packageId));
3147
}
3248

@@ -50,6 +66,9 @@ export default defineConfig({
5066
},
5167
},
5268
],
69+
ssr: {
70+
noExternal: bundledPackagePrefixes,
71+
},
5372
build: {
5473
emptyOutDir: true,
5574
minify: true,

0 commit comments

Comments
 (0)