build: stage nostr runtime dependencies

This commit is contained in:
Peter Steinberger
2026-04-08 20:04:51 +01:00
parent dbfcef3196
commit b3e7858051
2 changed files with 16 additions and 6 deletions

View File

@@ -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<string, string> {
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,
},
}),
]);