mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 09:00:42 +00:00
fix(plugins): avoid redundant public surface jiti config reads
This commit is contained in:
@@ -9,7 +9,7 @@ import { resolveBundledPluginPublicSurfacePath } from "./public-surface-runtime.
|
||||
import {
|
||||
buildPluginLoaderAliasMap,
|
||||
isBundledPluginExtensionPath,
|
||||
resolvePluginLoaderJitiConfig,
|
||||
resolvePluginLoaderJitiTryNative,
|
||||
resolveLoaderPackageRoot,
|
||||
} from "./sdk-alias.js";
|
||||
|
||||
@@ -94,12 +94,7 @@ function resolvePublicSurfaceLocation(params: {
|
||||
}
|
||||
|
||||
function getJiti(modulePath: string) {
|
||||
const { tryNative } = resolvePluginLoaderJitiConfig({
|
||||
modulePath,
|
||||
argv1: process.argv[1],
|
||||
moduleUrl: import.meta.url,
|
||||
preferBuiltDist: true,
|
||||
});
|
||||
const tryNative = resolvePluginLoaderJitiTryNative(modulePath, { preferBuiltDist: true });
|
||||
const sharedLoader = getSharedBundledPublicSurfaceJiti(modulePath, tryNative);
|
||||
if (sharedLoader) {
|
||||
return sharedLoader;
|
||||
@@ -115,12 +110,7 @@ function getJiti(modulePath: string) {
|
||||
}
|
||||
|
||||
function loadPublicSurfaceModule(modulePath: string): unknown {
|
||||
const { tryNative } = resolvePluginLoaderJitiConfig({
|
||||
modulePath,
|
||||
argv1: process.argv[1],
|
||||
moduleUrl: import.meta.url,
|
||||
preferBuiltDist: true,
|
||||
});
|
||||
const tryNative = resolvePluginLoaderJitiTryNative(modulePath, { preferBuiltDist: true });
|
||||
if (canUseSourceArtifactRequire({ modulePath, tryNative })) {
|
||||
return sourceArtifactRequire(modulePath);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user