diff --git a/extensions/nostr/package.json b/extensions/nostr/package.json index c0329b2b107..27a78a518f8 100644 --- a/extensions/nostr/package.json +++ b/extensions/nostr/package.json @@ -44,6 +44,9 @@ "build": { "openclawVersion": "2026.4.9" }, + "bundle": { + "stageRuntimeDependencies": true + }, "release": { "publishToClawHub": true, "publishToNpm": true diff --git a/tsdown.config.ts b/tsdown.config.ts index 870b735b0aa..55e9cda72c3 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -115,6 +115,18 @@ const bundledHookEntries = buildBundledHookEntries(); const bundledPluginRoot = (pluginId: string) => ["extensions", pluginId].join("/"); const bundledPluginFile = (pluginId: string, relativePath: string) => `${bundledPluginRoot(pluginId)}/${relativePath}`; +const explicitNeverBundleDependencies = [ + "@lancedb/lancedb", + "@matrix-org/matrix-sdk-crypto-nodejs", + "matrix-js-sdk", + ...bundledPluginRuntimeDependencies, +].toSorted((left, right) => left.localeCompare(right)); + +function shouldNeverBundleDependency(id: string): boolean { + return explicitNeverBundleDependencies.some((dependency) => { + return id === dependency || id.startsWith(`${dependency}/`); + }); +} function buildCoreDistEntries(): Record { return { @@ -170,12 +182,7 @@ export default defineConfig([ // and bundled hooks in one graph so runtime singletons are emitted once. entry: buildUnifiedDistEntries(), deps: { - neverBundle: [ - "@lancedb/lancedb", - "@matrix-org/matrix-sdk-crypto-nodejs", - "matrix-js-sdk", - ...bundledPluginRuntimeDependencies, - ], + neverBundle: shouldNeverBundleDependency, }, }), ]);