Compare commits

...

1 Commits

Author SHA1 Message Date
Vincent Koc
d35b54fe7d fix(plugins): keep openclaw chunks native in jiti 2026-05-30 18:44:35 +02:00
2 changed files with 4 additions and 0 deletions

View File

@@ -1765,6 +1765,7 @@ describe("plugin sdk alias helpers", () => {
const options = buildPluginLoaderJitiOptions({});
expect(options.tryNative).toBe(true);
expect(options.nativeModules).toEqual(["openclaw"]);
expect(options.interopDefault).toBe(true);
expect(options.extensions).toContain(".js");
expect(options.extensions).toContain(".ts");

View File

@@ -1665,6 +1665,9 @@ export function buildPluginLoaderJitiOptions(
// Prefer Node's native sync ESM loader for built dist/*.js modules so
// bundled plugins and plugin-sdk subpaths stay on the canonical module graph.
tryNative: true,
// When jiti must transform a plugin entry, keep OpenClaw's own package
// chunks on the native module graph instead of re-evaluating them in jiti.
nativeModules: ["openclaw"],
extensions: [".ts", ".tsx", ".mts", ".cts", ".mtsx", ".ctsx", ".js", ".mjs", ".cjs", ".json"],
...(hasAliases
? {