perf(plugins): lazy-create jiti loader

This commit is contained in:
Peter Steinberger
2026-02-15 19:18:02 +00:00
parent a6158873f5
commit c25026f2b3
3 changed files with 39 additions and 24 deletions

View File

@@ -66,7 +66,7 @@ describe("loadOpenClawPlugins", () => {
id: "bundled",
body: `export default { id: "bundled", register() {} };`,
dir: bundledDir,
filename: "bundled.ts",
filename: "bundled.js",
});
process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = bundledDir;
@@ -121,9 +121,9 @@ describe("loadOpenClawPlugins", () => {
outbound: { deliveryMode: "direct" }
}
});
} };`,
} };`,
dir: bundledDir,
filename: "telegram.ts",
filename: "telegram.js",
});
process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = bundledDir;
@@ -150,7 +150,7 @@ describe("loadOpenClawPlugins", () => {
id: "memory-core",
body: `export default { id: "memory-core", kind: "memory", register() {} };`,
dir: bundledDir,
filename: "memory-core.ts",
filename: "memory-core.js",
});
process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = bundledDir;
@@ -180,7 +180,7 @@ describe("loadOpenClawPlugins", () => {
name: "@openclaw/memory-core",
version: "1.2.3",
description: "Memory plugin package",
openclaw: { extensions: ["./index.ts"] },
openclaw: { extensions: ["./index.js"] },
}),
"utf-8",
);
@@ -188,7 +188,7 @@ describe("loadOpenClawPlugins", () => {
id: "memory-core",
body: `export default { id: "memory-core", kind: "memory", name: "Memory (Core)", register() {} };`,
dir: pluginDir,
filename: "index.ts",
filename: "index.js",
});
process.env.OPENCLAW_BUNDLED_PLUGINS_DIR = bundledDir;